@privy-io/react-auth 1.89.0 → 1.89.1-beta-20241010170842

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useContext as a,useState as t,useEffect as r,createContext as n}from"react";import{u as i,G as s}from"./useWallets.mjs";import{u as o,h as l,P as c}from"./privy-context.mjs";import{u as d,M as m,g as u}from"./getEmbeddedConnectedWallet.mjs";import{createSmartAccountClient as p}from"permissionless";import{toLightSmartAccount as y,toBiconomySmartAccount as g,toEcdsaKernelSmartAccount as h,toSafeSmartAccount as E}from"permissionless/accounts";import{createPimlicoClient as f}from"permissionless/clients/pimlico";import{createPublicClient as w,http as P}from"viem";import{entryPoint06Address as W,entryPoint07Address as v}from"viem/account-abstraction";import"tinycolor2";import"ofetch";let T=({calls:e,chain:a,maxPriorityFeePerGas:t,maxFeePerGas:r,nonce:n})=>e.map((e=>({to:e.to||void 0,data:e.data,value:e.value,chainId:a.id,nonce:n,maxFeePerGas:r,maxPriorityFeePerGas:t})));let S={address:W,version:"0.6"},C={address:v,version:"0.7"},N=async({owner:e,smartWalletType:a,chain:t,bundlerUrl:r,paymasterUrl:n,paymasterContext:i})=>{let s=w({chain:t,transport:P()}),o=await(({owner:e,smartWalletType:a,chain:t})=>{let r=w({chain:t,transport:P()});switch(a){case"safe":return E({client:r,entryPoint:C,owners:[e],version:"1.4.1"});case"kernel":return h({client:r,version:"0.3.1",entryPoint:C,owners:[e]});case"biconomy":return g({client:r,owners:[e],entryPoint:S});case"light_account":return y({client:r,entryPoint:S,owner:e,version:"1.1.0"});default:throw Error(`Invalid smart account type: ${a}.`)}})({owner:e,smartWalletType:a,chain:t}),l=n?f({transport:P(n),entryPoint:o.entryPoint}):void 0;return p({account:o,chain:t,paymaster:l,paymasterContext:i,bundlerTransport:P(r),userOperation:{estimateFeesPerGas:async()=>{let e=await s.estimateFeesPerGas();return{...e,maxFeePerGas:125n*e.maxFeePerGas/100n,maxPriorityFeePerGas:125n*e.maxPriorityFeePerGas/100n}}}})};let x=n({client:void 0});const D=({config:a,children:t})=>e(b,{children:e(I,{config:a,children:e(O,{children:t})})}),F=()=>{let{client:e}=a(x);return{client:e}};let _=n({config:void 0}),G=()=>{let{config:e}=a(_);return{config:e}},b=({children:a})=>{let[n,i]=t(void 0),{client:s}=o();return r((()=>{!n&&s&&(async()=>{try{if(!s)return void console.warn("No client found");let e=await s.getSmartWalletsConfig();i(e)}catch(e){console.warn("Error generating smart wallet config: ",e)}})()}),[!!s]),e(_.Provider,{value:{config:n},children:a})},I=({config:a,children:n})=>{let{config:o}=G(),{defaultChain:d}=i(),[m]=t(d),{wallets:p}=s(),{user:y}=l(),[g,h]=t(),E=u(p);return r((()=>{(async()=>{if(!o?.enabled||!y||!E)return void h(void 0);if(g&&g.chain.id===m.id)return;let e=o.configuredNetworks.find((e=>e.chainId===`eip155:${m.id}`));if(!e)throw new c(`The chain ${m.name} (eip155:${m.id}) must be configured in the smart wallet configuration in your dashboard`);let t=y.smartWallet?.smartWalletType??o.smartWalletType;try{let r=await(async(e,a,t,r,n)=>{let i=await e.getEthereumProvider();return await N({owner:i,smartWalletType:t,chain:a,paymasterContext:n,...r})})(E,m,t,e,a?.paymasterContext);h(r)}catch(e){console.error("Error loading smart wallet:",e)}})()}),[!!o?.enabled,!!y?.smartWallet,!!E]),e(M.Provider,{value:{client:g},children:n})},M=n({client:void 0}),O=({children:t})=>{let{client:n}=(()=>{let{client:e}=a(M);return{client:e}})(),{config:s}=G(),{wrapSmartAccountClient:c}=(()=>{let{noPromptOnSignature:e,openPrivyModal:a}=o(),t=i(),{setModalData:r}=d();return{wrapSmartAccountClient:n=>{let{sendTransaction:i,signMessage:s,signTypedData:o,...l}=n;return{...l,sendTransaction:async n=>{if(void 0===t.embeddedWallets.showWalletUIs?t.embeddedWallets.noPromptOnSignature:!t.embeddedWallets.showWalletUIs)return e.current=!0,await i(n).finally((()=>e.current=!1));let s=[];"calls"in n&&void 0!==n.calls?s=[...n.calls]:"to"in n&&(s=[{to:n.to,value:n.value||BigInt(0),data:n.data||"0x"}]);let o=async()=>{if(!l.paymaster)return!1;let{paymasterAndData:e,paymasterData:a}=await l.prepareUserOperation({calls:s,maxFeePerGas:n.maxFeePerGas,maxPriorityFeePerGas:n.maxPriorityFeePerGas,nonce:n.nonce?BigInt(n.nonce):void 0});return Number(e??a??0)>0};return new Promise((async(t,c)=>{e.current=!0,r({connectWallet:{onCompleteNavigateTo:m.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:T({calls:s,chain:l.chain,maxPriorityFeePerGas:n.maxPriorityFeePerGas,maxFeePerGas:n.maxFeePerGas,nonce:n.nonce?BigInt(n.nonce):void 0}),rootWallet:{address:l.account.address},transactingWallet:{address:l.account.address,walletIndex:null},getIsSponsored:o,onConfirm:()=>i(n),onSuccess:e=>t(e.hash),onFailure:c,uiOptions:{}}}),a(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1}))},signMessage:async({message:n})=>(void 0===t.embeddedWallets.showWalletUIs?t.embeddedWallets.noPromptOnSignature:!t.embeddedWallets.showWalletUIs)?(e.current=!0,await s({message:n}).finally((()=>e.current=!1))):new Promise((async(t,i)=>{e.current=!0,r({connectWallet:{onCompleteNavigateTo:m.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:n,confirmAndSign:()=>s({message:n}),onSuccess:e=>t(e),onFailure:i,uiOptions:{}}}),a(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1})),signTypedData:async n=>(void 0===t.embeddedWallets.showWalletUIs?t.embeddedWallets.noPromptOnSignature:!t.embeddedWallets.showWalletUIs)?(e.current=!0,await o(n).finally((()=>e.current=!1))):new Promise((async(t,i)=>{e.current=!0,r({connectWallet:{onCompleteNavigateTo:m.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:n,confirmAndSign:()=>o(n),onSuccess:e=>t(e),onFailure:i,uiOptions:{}}}),a(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1}))}}}})(),{user:u}=l(),{generateSiweMessageForSmartWallet:p,linkSmartWallet:y,noPromptOnSignature:g}=o();return r((()=>{(async()=>{if(n&&!u?.smartWallet&&s?.enabled)try{let e=await p({address:n.account.address,chainId:`eip155:${n.chain.id}`});g.current=!0;let a=await n.signMessage({message:e});await y({signature:a,message:e,smartWalletType:s.smartWalletType})}catch(e){console.error("Error creating smart wallet:",e)}finally{g.current=!1}})()}),[!!n,!!u?.smartWallet,!!s?.enabled]),e(x.Provider,{value:{client:u?.smartWallet&&n?c(n):void 0},children:t})};export{D as SmartWalletsProvider,F as useSmartWallets};
1
+ import{jsx as e}from"react/jsx-runtime";import{useContext as t,useState as a,useEffect as r,createContext as n}from"react";import{u as i,G as s}from"./useWallets.mjs";import{u as o,h as l,P as c}from"./privy-context.mjs";import{u as d,M as m,g as u}from"./getEmbeddedConnectedWallet.mjs";import{createSmartAccountClient as p}from"permissionless";import{toLightSmartAccount as y,toBiconomySmartAccount as g,toEcdsaKernelSmartAccount as h,toSafeSmartAccount as E}from"permissionless/accounts";import{createPimlicoClient as f}from"permissionless/clients/pimlico";import{createPublicClient as P,http as w}from"viem";import{entryPoint06Address as W,entryPoint07Address as v}from"viem/account-abstraction";import"tinycolor2";import"ofetch";let T=({calls:e,chain:t,maxPriorityFeePerGas:a,maxFeePerGas:r,nonce:n})=>e.map((e=>({to:e.to||void 0,data:e.data,value:e.value,chainId:t.id,nonce:n,maxFeePerGas:r,maxPriorityFeePerGas:a})));let S={address:W,version:"0.6"},C={address:v,version:"0.7"},N=["rpc.zerodev.app","public.pimlico.io","api.pimlico.io"],x=async({owner:e,smartWalletType:t,chain:a,bundlerUrl:r,paymasterUrl:n,paymasterContext:i})=>{let s=P({chain:a,transport:w()}),o=await(({owner:e,smartWalletType:t,chain:a})=>{let r=P({chain:a,transport:w()});switch(t){case"safe":return E({client:r,entryPoint:C,owners:[e],version:"1.4.1"});case"kernel":return h({client:r,version:"0.3.1",entryPoint:C,owners:[e]});case"biconomy":return g({client:r,owners:[e],entryPoint:S});case"light_account":return y({client:r,entryPoint:S,owner:e,version:"1.1.0"});default:throw Error(`Invalid smart account type: ${t}.`)}})({owner:e,smartWalletType:t,chain:a}),l=f({transport:w(r),entryPoint:o.entryPoint}),c=n?f({transport:w(n),entryPoint:o.entryPoint}):void 0;return p({account:o,chain:a,paymaster:c,paymasterContext:i,bundlerTransport:w(r),userOperation:{estimateFeesPerGas:async()=>{if(N.some((e=>r.includes(e))))return await l.getUserOperationGasPrice().then((e=>e.fast));{let e=await s.estimateFeesPerGas();return{...e,maxFeePerGas:125n*e.maxFeePerGas/100n,maxPriorityFeePerGas:125n*e.maxPriorityFeePerGas/100n}}}}})};let D=n({client:void 0});const F=({config:t,children:a})=>e(I,{children:e(M,{config:t,children:e(A,{children:a})})}),G=()=>{let{client:e}=t(D);return{client:e}};let _=n({config:void 0}),b=()=>{let{config:e}=t(_);return{config:e}},I=({children:t})=>{let[n,i]=a(void 0),{client:s}=o();return r((()=>{!n&&s&&(async()=>{try{if(!s)return void console.warn("No client found");let e=await s.getSmartWalletsConfig();i(e)}catch(e){console.warn("Error generating smart wallet config: ",e)}})()}),[!!s]),e(_.Provider,{value:{config:n},children:t})},M=({config:t,children:n})=>{let{config:o}=b(),{defaultChain:d}=i(),[m]=a(d),{wallets:p}=s(),{user:y}=l(),[g,h]=a(),E=u(p);return r((()=>{(async()=>{if(!o?.enabled||!y||!E)return void h(void 0);if(g&&g.chain.id===m.id)return;let e=o.configuredNetworks.find((e=>e.chainId===`eip155:${m.id}`));if(!e)throw new c(`The chain ${m.name} (eip155:${m.id}) must be configured in the smart wallet configuration in your dashboard`);let a=y.smartWallet?.smartWalletType??o.smartWalletType;try{let r=await(async(e,t,a,r,n)=>{let i=await e.getEthereumProvider();return await x({owner:i,smartWalletType:a,chain:t,paymasterContext:n,...r})})(E,m,a,e,t?.paymasterContext);h(r)}catch(e){console.error("Error loading smart wallet:",e)}})()}),[!!o?.enabled,!!y?.smartWallet,!!E]),e(O.Provider,{value:{client:g},children:n})},O=n({client:void 0}),A=({children:a})=>{let{client:n}=(()=>{let{client:e}=t(O);return{client:e}})(),{config:s}=b(),{wrapSmartAccountClient:c}=(()=>{let{noPromptOnSignature:e,openPrivyModal:t}=o(),a=i(),{setModalData:r}=d();return{wrapSmartAccountClient:n=>{let{sendTransaction:i,signMessage:s,signTypedData:o,...l}=n;return{...l,sendTransaction:async n=>{if(void 0===a.embeddedWallets.showWalletUIs?a.embeddedWallets.noPromptOnSignature:!a.embeddedWallets.showWalletUIs)return e.current=!0,await i(n).finally((()=>e.current=!1));let s=[];"calls"in n&&void 0!==n.calls?s=[...n.calls]:"to"in n&&(s=[{to:n.to,value:n.value||BigInt(0),data:n.data||"0x"}]);let o=async()=>{if(!l.paymaster)return!1;let{paymasterAndData:e,paymasterData:t}=await l.prepareUserOperation({calls:s,maxFeePerGas:n.maxFeePerGas,maxPriorityFeePerGas:n.maxPriorityFeePerGas,nonce:n.nonce?BigInt(n.nonce):void 0});return Number(e??t??0)>0};return new Promise((async(a,c)=>{e.current=!0,r({connectWallet:{onCompleteNavigateTo:m.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:T({calls:s,chain:l.chain,maxPriorityFeePerGas:n.maxPriorityFeePerGas,maxFeePerGas:n.maxFeePerGas,nonce:n.nonce?BigInt(n.nonce):void 0}),rootWallet:{address:l.account.address},transactingWallet:{address:l.account.address,walletIndex:null},getIsSponsored:o,onConfirm:()=>i(n),onSuccess:e=>a(e.hash),onFailure:c,uiOptions:{}}}),t(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1}))},signMessage:async({message:n})=>(void 0===a.embeddedWallets.showWalletUIs?a.embeddedWallets.noPromptOnSignature:!a.embeddedWallets.showWalletUIs)?(e.current=!0,await s({message:n}).finally((()=>e.current=!1))):new Promise((async(a,i)=>{e.current=!0,r({connectWallet:{onCompleteNavigateTo:m.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:n,confirmAndSign:()=>s({message:n}),onSuccess:e=>a(e),onFailure:i,uiOptions:{}}}),t(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1})),signTypedData:async n=>(void 0===a.embeddedWallets.showWalletUIs?a.embeddedWallets.noPromptOnSignature:!a.embeddedWallets.showWalletUIs)?(e.current=!0,await o(n).finally((()=>e.current=!1))):new Promise((async(a,i)=>{e.current=!0,r({connectWallet:{onCompleteNavigateTo:m.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:n,confirmAndSign:()=>o(n),onSuccess:e=>a(e),onFailure:i,uiOptions:{}}}),t(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1}))}}}})(),{user:u}=l(),{generateSiweMessageForSmartWallet:p,linkSmartWallet:y,noPromptOnSignature:g}=o();return r((()=>{(async()=>{if(n&&!u?.smartWallet&&s?.enabled)try{let e=await p({address:n.account.address,chainId:`eip155:${n.chain.id}`});g.current=!0;let t=await n.signMessage({message:e});await y({signature:t,message:e,smartWalletType:s.smartWalletType})}catch(e){console.error("Error creating smart wallet:",e)}finally{g.current=!1}})()}),[!!n,!!u?.smartWallet,!!s?.enabled]),e(D.Provider,{value:{client:u?.smartWallet&&n?c(n):void 0},children:a})};export{F as SmartWalletsProvider,G as useSmartWallets};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as t,useMemo as a,useEffect as n,useContext as r,createContext as o}from"react";import l from"tinycolor2";const i="https://auth.privy.io",s=2e4,p=1400,c=2500,h=4e3,u="1.89.0",d="privy:token",m="privy-token",g="privy:refresh_token",f="privy-refresh-token",y="privy:id_token",b="privy-id-token",w="privy-session",v="privy:session_transfer_token",C="privy:caid",k=e=>`privy:guest:${e}`,E=e=>`privy:cross-app:${e}`,S="privy:state_code",x="privy:code_verifier",O="privy:headless_oauth",U="privy:oauth_disable_signup",A=e=>`privy:wallet:${e}`,M="privy:connectors",W="privy:connections",H=12e4,L=1,T="0x1",F=3e4,_="https://api.moonpay.com/v1",P="https://api.moonpay.com/v1",z="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",j="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",B="deprecated",I={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"}}},R={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},D={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"}}},q={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},K={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"}}},Y={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},Z={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},$={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},G={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"}}},X={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"}}},J={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},N={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"}}},V={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},Q={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},ee={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"}}},te=[I,R,Q,G,X,J,N,V,Z,{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"}}},K,Y,{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"}}},$,{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},D,q,ee,{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"}}}],ae=new Set(te.map((e=>e.id))),ne={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let re=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),oe=e=>re.has(e),le=(e,t,a)=>a.indexOf(e)===t;const ie=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(oe).filter(le):e?e.filter(oe).filter(le):ne.appearance.walletList;function se(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function pe(e){let t=e.filter((e=>!ae.has(e.id)));return te.concat(t)}function ce(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let he="#FFFFFF";function ue(e,t){let a=Math.max(0,Math.min(1,e.toHsl().l+t));return l({...e.toHsl(),l:a})}function de({backgroundTheme:e,accentHex:t}){let a;switch(e){case"light":a=he;break;case"dark":a="#1E1E1D";break;default:a=e}let n=l(a),r=l(t),o=l("#51BA81"),i=l("#FFB74D"),s=l("#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=ue(n,"light"===p?-.04:.11),h=ue(n,"light"===p?-.88:.87),u=ue(n,"light"===p?-.7:.75),d=ue(n,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=ue(n,"light"===p?-.08:.25).desaturate("light"===p?60:20),g=ue(r,.15),f=ue(r,-.06),y=ue(s,.3),b=ue(i,.3),w=l(r.getLuminance()>.5?"#040217":he),v=ue(o,-.16),C=ue(o,.4);return{colorScheme:p,background:n.toHslString(),background2:c.toHslString(),foreground:h.toHslString(),foreground2:u.toHslString(),foreground3:d.toHslString(),foreground4:m.toHslString(),accent:r.toHslString(),accentLight:g.toHslString(),accentDark:f.toHslString(),foregroundAccent:w.toHslString(),success:o.toHslString(),successDark:v.toHslString(),successLight:C.toHslString(),error:s.toHslString(),errorLight:y.toHslString(),warn:i.toHslString(),warnLight:b.toHslString()}}function me(e,t,a){let n,r,o,l,i,s,p,c,h,u,d,m,g,f,y,b,w=a?console.warn:()=>{};t?.loginMethods?(n=t.loginMethods.includes("email"),r=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),i=t.loginMethods.includes("google"),s=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),h=t.loginMethods.includes("spotify"),u=t.loginMethods.includes("instagram"),c=t.loginMethods.includes("tiktok"),m=t.loginMethods.includes("github"),d=t.loginMethods.includes("linkedin"),g=t.loginMethods.includes("apple"),f=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram")):(n=e.emailAuth,r=e.smsAuth,l=e.walletAuth,i=e.googleOAuth,s=e.twitterOAuth,p=e.discordOAuth,m=e.githubOAuth,h=e.spotifyOAuth,u=e.instagramOAuth,c=e.tiktokOAuth,d=e.linkedinOAuth,g=e.appleOAuth,f=e.farcasterAuth,y=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?o=!1:e.passkeyAuth&&(o=!0);let v=[n,r].filter(Boolean),C=[i,s,p,m,h,u,c,d,g,f,y].filter(Boolean),k=[l].filter(Boolean);if(v.length+C.length+k.length===0)throw Error("You must enable at least one login method");let E=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;E&&0===k.length?(w("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),E=!1):E||C.length+v.length!==0||(w("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),E=!0);let S=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&w("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let x=ie({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),O=(({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}),U=t?.intl?.defaultCountry??"US",{chains:A,defaultChain:M}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:a,hasRpcConfigDefined:n}){let r;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(0===t.length)throw Error("`supportedChains` must contain at least one chain");t.filter((e=>e.rpcUrls.privyWalletOverride)).length>0&&n&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),r=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=te.find((t=>t.id===e.id)),a=t?.rpcUrls.privy?.http[0];return a?ce(e,a):e}))}else r=te.concat(e??[]);let o=t?r[0]:G,l=a??o;if(!r.find((e=>e.id===l.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:r,defaultChain:l}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),W=!!t?.defaultChain,H=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,L=!(e.enforceWalletUis??1);if(b=e.legacyWalletUiConfig??1?H?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??L:L,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==b)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:T,...F}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??ne.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:de({backgroundTheme:t?.appearance?.theme??ne.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??ne.appearance.accentColor}),loginGroupPriority:E?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:x,walletChainType:t?.appearance?.walletChainType??"ethereum-only"},loginMethods:{wallet:l,email:n,sms:r,passkey:o,google:i,twitter:s,discord:p,github:m,spotify:h,instagram:u,tiktok:c,linkedin:d,apple:g,farcaster:f,telegram:y},loginMethodsAndOrder:O,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??ne.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??ne.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??ne.rpcConfig.rpcTimeouts},chains:A,defaultChain:M,intl:{defaultCountry:U},shouldEnforceDefaultChainOnConnect:W,captchaEnabled:e.captchaEnabled??ne.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??ne.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:S},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof T?{requireUserOwnedRecoveryOnCreate:T}:{},...H?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...F,noPromptOnSignature:b,showWalletUIs:t?.embeddedWallets?.showWalletUIs},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:H?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??ne._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??ne.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??ne.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??ne.fundingMethodConfig.moonpay.useSandbox}}}}let ge={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""};const fe=me(ge,void 0,!1);let ye=o({appConfig:fe,isServerConfigLoaded:!1});const be=({children:r,legacyCreateEmbeddedWalletFlag:o,client:l,clientConfig:i})=>{let[s,p]=t(null),c=a((()=>me(s??ge,i,!!s)),[s,i]);return n((()=>{if(!s)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:a,additionalChains:n,supportedChains:r,defaultChain:o,externalWallets:l,...i}=e;return{...i,...n?{additionalChains:n.map((e=>e.id))}:void 0,...r?{supportedChains:r.map((e=>e.id))}:void 0,...o?{defaultChain:o.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:l.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(i,o),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:${s.id}:${t}`;localStorage.getItem(a)||(l.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(a,"t"))}),[i,o,s]),n((()=>{s||(async()=>{try{let e=await l.getServerConfig();e.customApiUrl&&l.updateApiUrl(e.customApiUrl),p(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),e(ye.Provider,{value:{appConfig:c,isServerConfigLoaded:!!s},children:r})},we=()=>{let{appConfig:e}=r(ye);return e},ve=()=>{let{isServerConfigLoaded:e}=r(ye);return e},Ce=o(null);function ke(){let e=r(Ce);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e}export{ve as $,X as A,N as B,x as C,H as D,ee as E,v as F,ke as G,O as H,y as I,h as J,_ as K,j as L,P as M,z as N,U as O,Q as P,J as Q,g as R,S,d as T,V as U,u as V,F as W,Y as X,q as Y,R as Z,be as _,A as a,Ce as a0,te as a1,se as a2,ce as a3,fe as a4,T as b,ae as c,M as d,W as e,E as f,k as g,w as h,B as i,m as j,f as k,b as l,i as m,s as n,C as o,p,c as q,L as r,pe as s,I as t,we as u,D as v,K as w,Z as x,$ as y,G as z};
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as t,useMemo as a,useEffect as n,useContext as r,createContext as o}from"react";import l from"tinycolor2";const i="https://auth.privy.io",s=2e4,p=1400,c=2500,h=4e3,u="1.89.1-beta-20241010170842",d="privy:token",m="privy-token",g="privy:refresh_token",f="privy-refresh-token",y="privy:id_token",b="privy-id-token",w="privy-session",v="privy:session_transfer_token",C="privy:caid",k=e=>`privy:guest:${e}`,E=e=>`privy:cross-app:${e}`,S="privy:state_code",x="privy:code_verifier",O="privy:headless_oauth",U="privy:oauth_disable_signup",A=e=>`privy:wallet:${e}`,M="privy:connectors",W="privy:connections",H=12e4,L=1,T="0x1",F=3e4,_="https://api.moonpay.com/v1",P="https://api.moonpay.com/v1",z="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",j="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",B="deprecated",I={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"}}},R={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},D={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"}}},q={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},K={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"}}},Y={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},Z={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},$={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},G={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"}}},X={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"}}},J={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},N={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"}}},V={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},Q={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},ee={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"}}},te=[I,R,Q,G,X,J,N,V,Z,{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"}}},K,Y,{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"}}},$,{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},D,q,ee,{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"}}}],ae=new Set(te.map((e=>e.id))),ne={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let re=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),oe=e=>re.has(e),le=(e,t,a)=>a.indexOf(e)===t;const ie=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(oe).filter(le):e?e.filter(oe).filter(le):ne.appearance.walletList;function se(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function pe(e){let t=e.filter((e=>!ae.has(e.id)));return te.concat(t)}function ce(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let he="#FFFFFF";function ue(e,t){let a=Math.max(0,Math.min(1,e.toHsl().l+t));return l({...e.toHsl(),l:a})}function de({backgroundTheme:e,accentHex:t}){let a;switch(e){case"light":a=he;break;case"dark":a="#1E1E1D";break;default:a=e}let n=l(a),r=l(t),o=l("#51BA81"),i=l("#FFB74D"),s=l("#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=ue(n,"light"===p?-.04:.11),h=ue(n,"light"===p?-.88:.87),u=ue(n,"light"===p?-.7:.75),d=ue(n,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=ue(n,"light"===p?-.08:.25).desaturate("light"===p?60:20),g=ue(r,.15),f=ue(r,-.06),y=ue(s,.3),b=ue(i,.3),w=l(r.getLuminance()>.5?"#040217":he),v=ue(o,-.16),C=ue(o,.4);return{colorScheme:p,background:n.toHslString(),background2:c.toHslString(),foreground:h.toHslString(),foreground2:u.toHslString(),foreground3:d.toHslString(),foreground4:m.toHslString(),accent:r.toHslString(),accentLight:g.toHslString(),accentDark:f.toHslString(),foregroundAccent:w.toHslString(),success:o.toHslString(),successDark:v.toHslString(),successLight:C.toHslString(),error:s.toHslString(),errorLight:y.toHslString(),warn:i.toHslString(),warnLight:b.toHslString()}}function me(e,t,a){let n,r,o,l,i,s,p,c,h,u,d,m,g,f,y,b,w=a?console.warn:()=>{};t?.loginMethods?(n=t.loginMethods.includes("email"),r=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),i=t.loginMethods.includes("google"),s=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),h=t.loginMethods.includes("spotify"),u=t.loginMethods.includes("instagram"),c=t.loginMethods.includes("tiktok"),m=t.loginMethods.includes("github"),d=t.loginMethods.includes("linkedin"),g=t.loginMethods.includes("apple"),f=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram")):(n=e.emailAuth,r=e.smsAuth,l=e.walletAuth,i=e.googleOAuth,s=e.twitterOAuth,p=e.discordOAuth,m=e.githubOAuth,h=e.spotifyOAuth,u=e.instagramOAuth,c=e.tiktokOAuth,d=e.linkedinOAuth,g=e.appleOAuth,f=e.farcasterAuth,y=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?o=!1:e.passkeyAuth&&(o=!0);let v=[n,r].filter(Boolean),C=[i,s,p,m,h,u,c,d,g,f,y].filter(Boolean),k=[l].filter(Boolean);if(v.length+C.length+k.length===0)throw Error("You must enable at least one login method");let E=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;E&&0===k.length?(w("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),E=!1):E||C.length+v.length!==0||(w("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),E=!0);let S=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&w("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let x=ie({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),O=(({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}),U=t?.intl?.defaultCountry??"US",{chains:A,defaultChain:M}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:a,hasRpcConfigDefined:n}){let r;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(0===t.length)throw Error("`supportedChains` must contain at least one chain");t.filter((e=>e.rpcUrls.privyWalletOverride)).length>0&&n&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),r=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=te.find((t=>t.id===e.id)),a=t?.rpcUrls.privy?.http[0];return a?ce(e,a):e}))}else r=te.concat(e??[]);let o=t?r[0]:G,l=a??o;if(!r.find((e=>e.id===l.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:r,defaultChain:l}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),W=!!t?.defaultChain,H=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,L=!(e.enforceWalletUis??1);if(b=e.legacyWalletUiConfig??1?H?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??L:L,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==b)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:T,...F}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??ne.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:de({backgroundTheme:t?.appearance?.theme??ne.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??ne.appearance.accentColor}),loginGroupPriority:E?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:x,walletChainType:t?.appearance?.walletChainType??"ethereum-only"},loginMethods:{wallet:l,email:n,sms:r,passkey:o,google:i,twitter:s,discord:p,github:m,spotify:h,instagram:u,tiktok:c,linkedin:d,apple:g,farcaster:f,telegram:y},loginMethodsAndOrder:O,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??ne.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??ne.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??ne.rpcConfig.rpcTimeouts},chains:A,defaultChain:M,intl:{defaultCountry:U},shouldEnforceDefaultChainOnConnect:W,captchaEnabled:e.captchaEnabled??ne.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??ne.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:S},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof T?{requireUserOwnedRecoveryOnCreate:T}:{},...H?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...F,noPromptOnSignature:b,showWalletUIs:t?.embeddedWallets?.showWalletUIs},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:H?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??ne._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??ne.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??ne.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??ne.fundingMethodConfig.moonpay.useSandbox}}}}let ge={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""};const fe=me(ge,void 0,!1);let ye=o({appConfig:fe,isServerConfigLoaded:!1});const be=({children:r,legacyCreateEmbeddedWalletFlag:o,client:l,clientConfig:i})=>{let[s,p]=t(null),c=a((()=>me(s??ge,i,!!s)),[s,i]);return n((()=>{if(!s)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:a,additionalChains:n,supportedChains:r,defaultChain:o,externalWallets:l,...i}=e;return{...i,...n?{additionalChains:n.map((e=>e.id))}:void 0,...r?{supportedChains:r.map((e=>e.id))}:void 0,...o?{defaultChain:o.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:l.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(i,o),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:${s.id}:${t}`;localStorage.getItem(a)||(l.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(a,"t"))}),[i,o,s]),n((()=>{s||(async()=>{try{let e=await l.getServerConfig();e.customApiUrl&&l.updateApiUrl(e.customApiUrl),p(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),e(ye.Provider,{value:{appConfig:c,isServerConfigLoaded:!!s},children:r})},we=()=>{let{appConfig:e}=r(ye);return e},ve=()=>{let{isServerConfigLoaded:e}=r(ye);return e},Ce=o(null);function ke(){let e=r(Ce);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e}export{ve as $,X as A,N as B,x as C,H as D,ee as E,v as F,ke as G,O as H,y as I,h as J,_ as K,j as L,P as M,z as N,U as O,Q as P,J as Q,g as R,S,d as T,V as U,u as V,F as W,Y as X,q as Y,R as Z,be as _,A as a,Ce as a0,te as a1,se as a2,ce as a3,fe as a4,T as b,ae as c,M as d,W as e,E as f,k as g,w as h,B as i,m as j,f as k,b as l,i as m,s as n,C as o,p,c as q,L as r,pe as s,I as t,we as u,D as v,K as w,Z as x,$ as y,G as z};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@privy-io/react-auth",
3
- "version": "1.89.0",
3
+ "version": "1.89.1-beta-20241010170842",
4
4
  "description": "React client for the Privy Auth API",
5
5
  "keywords": [
6
6
  "authentication",
@@ -107,7 +107,7 @@
107
107
  "@heroicons/react": "^2.1.1",
108
108
  "@marsidev/react-turnstile": "^0.4.1",
109
109
  "@metamask/eth-sig-util": "^6.0.0",
110
- "@privy-io/js-sdk-core": "0.28.8",
110
+ "@privy-io/js-sdk-core": "0.28.9-beta-20241010170842",
111
111
  "@simplewebauthn/browser": "^9.0.1",
112
112
  "@solana/wallet-adapter-base": "^0.9.23",
113
113
  "@solana/wallet-standard-wallet-adapter-base": "^1.1.2",