@privy-io/react-auth 1.92.0 → 1.92.1-beta-20241018171533

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.
Files changed (37) hide show
  1. package/dist/cjs/getEmbeddedConnectedWallet-DMh1EGDu.js +1 -0
  2. package/dist/cjs/index.js +325 -325
  3. package/dist/cjs/smart-wallets.js +1 -1
  4. package/dist/cjs/solana.js +1 -1
  5. package/dist/cjs/ui.js +21 -21
  6. package/dist/cjs/{useFundWallet.js → useFundWallet-BM9BMkZ1.js} +2 -2
  7. package/dist/cjs/useSolanaWallets-B7NjCslk.js +1 -0
  8. package/dist/cjs/useWallets-FaTHnjJb.js +1 -0
  9. package/dist/dts/index.d.mts +4 -4
  10. package/dist/dts/index.d.ts +4 -4
  11. package/dist/dts/{solana.d2.ts → solana-Du0tGZK-.d.mts} +1 -1
  12. package/dist/dts/solana-Du0tGZK-.d.ts +352 -0
  13. package/dist/dts/solana.d.mts +2 -2
  14. package/dist/dts/solana.d.ts +2 -2
  15. package/dist/dts/ui.d.mts +1 -1
  16. package/dist/dts/ui.d.ts +1 -1
  17. package/dist/esm/getEmbeddedConnectedWallet-8UFonhW7.mjs +1 -0
  18. package/dist/esm/index.mjs +325 -325
  19. package/dist/esm/smart-wallets.mjs +1 -1
  20. package/dist/esm/solana.mjs +1 -1
  21. package/dist/esm/ui.mjs +6 -6
  22. package/dist/esm/{useFundWallet.mjs → useFundWallet-BKLraflK.mjs} +1 -1
  23. package/dist/esm/useSolanaWallets-DFH-p-7f.mjs +1 -0
  24. package/dist/esm/useWallets-CiR4ebYz.mjs +1 -0
  25. package/package.json +1 -1
  26. package/dist/cjs/getEmbeddedConnectedWallet.js +0 -1
  27. package/dist/cjs/useSolanaWallets.js +0 -1
  28. package/dist/cjs/useWallets.js +0 -1
  29. package/dist/esm/getEmbeddedConnectedWallet.mjs +0 -1
  30. package/dist/esm/useSolanaWallets.mjs +0 -1
  31. package/dist/esm/useWallets.mjs +0 -1
  32. /package/dist/cjs/{events-context.js → events-context-DZk3apgV.js} +0 -0
  33. /package/dist/cjs/{privy-context.js → privy-context-Do1698Nd.js} +0 -0
  34. /package/dist/dts/{types.d.mts → types-B8PCl2VL.d.mts} +0 -0
  35. /package/dist/dts/{types.d.ts → types-B8PCl2VL.d.ts} +0 -0
  36. /package/dist/esm/{events-context.mjs → events-context-DLn7buIf.mjs} +0 -0
  37. /package/dist/esm/{privy-context.mjs → privy-context-QVrL4VJ3.mjs} +0 -0
@@ -0,0 +1 @@
1
+ "use strict";var e=require("@ethersproject/providers"),t=require("./privy-context-Do1698Nd.js"),r=require("react/jsx-runtime"),o=require("react");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(require("tinycolor2"));const i=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,l=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==i(e))return!1;if(e.providers)for(let t of e.providers)if(!l(t))return!1;return!0},s=(e,t=3,r=4,o="ethereum")=>{if(!e)return"";let a="ethereum"===o?2:0;return t+r+a+3>=e.length?e:`${e.slice(0,a+t)}...${e.slice(e.length-r,e.length)}`},p=e=>new Promise((t=>setTimeout(t,e)));const c=(e,r,o)=>{let a,n=e.id,i=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])a=e.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[i])a=r.rpcUrls[i];else if(e.rpcUrls.privy?.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",o),a=t.toString()}else a=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!a)throw new t.PrivyConnectorError(`No RPC url found for ${n}`);return a};const u={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"}}},h={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"}}},m={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},f={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},y={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},b={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},w={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"}}},v={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"}}},C={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},E={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"}}},x={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},k={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},S={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"}}},O=[u,h,k,w,v,C,E,x,y,{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"}}},f,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"}}},b,{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,m,S,{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"}}}],U=new Set(O.map((e=>e.id))),A={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 T=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"]),_=e=>T.has(e),W=(e,t,r)=>r.indexOf(e)===t;const P=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(_).filter(W):e?e.filter(_).filter(W):A.appearance.walletList;function I(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let M="#FFFFFF";function F(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return n.default({...e.toHsl(),l:r})}function L({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=M;break;case"dark":r="#1E1E1D";break;default:r=e}let o=n.default(r),a=n.default(t),i=n.default("#51BA81"),l=n.default("#FFB74D"),s=n.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"}(o.getLuminance()),c=F(o,"light"===p?-.04:.11),u=F(o,"light"===p?-.88:.87),h=F(o,"light"===p?-.7:.75),d=F(o,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=F(o,"light"===p?-.08:.25).desaturate("light"===p?60:20),f=F(a,.15),g=F(a,-.06),y=F(s,.3),b=F(l,.3),w=n.default(a.getLuminance()>.5?"#040217":M),v=F(i,-.16),C=F(i,.4);return{colorScheme:p,background:o.toHslString(),background2:c.toHslString(),foreground:u.toHslString(),foreground2:h.toHslString(),foreground3:d.toHslString(),foreground4:m.toHslString(),accent:a.toHslString(),accentLight:f.toHslString(),accentDark:g.toHslString(),foregroundAccent:w.toHslString(),success:i.toHslString(),successDark:v.toHslString(),successLight:C.toHslString(),error:s.toHslString(),errorLight:y.toHslString(),warn:l.toHslString(),warnLight:b.toHslString()}}function D(e,t,r){let o,a,n,i,l,s,p,c,u,h,d,m,f,g,y,b,v=r?console.warn:()=>{};t?.loginMethods?(o=t.loginMethods.includes("email"),a=t.loginMethods.includes("sms"),i=t.loginMethods.includes("wallet"),l=t.loginMethods.includes("google"),s=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),h=t.loginMethods.includes("instagram"),c=t.loginMethods.includes("tiktok"),m=t.loginMethods.includes("github"),d=t.loginMethods.includes("linkedin"),f=t.loginMethods.includes("apple"),g=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram")):(o=e.emailAuth,a=e.smsAuth,i=e.walletAuth,l=e.googleOAuth,s=e.twitterOAuth,p=e.discordOAuth,m=e.githubOAuth,u=e.spotifyOAuth,h=e.instagramOAuth,c=e.tiktokOAuth,d=e.linkedinOAuth,f=e.appleOAuth,g=e.farcasterAuth,y=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?n=!1:e.passkeyAuth&&(n=!0);let C=[o,a].filter(Boolean),E=[l,s,p,m,u,h,c,d,f,g,y].filter(Boolean),x=[i].filter(Boolean);if(C.length+E.length+x.length===0)throw Error("You must enable at least one login method");let k=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;k&&0===x.length?(v("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),k=!1):k||E.length+C.length!==0||(v("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),k=!0);let S=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&v("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let U=P({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),T=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];for(let r 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(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let o of e.overflow??[])t.includes(o)||r.includes(o)?console.warn(`Duplicated login method: ${o}`):r.push(o);return{primary:t,overflow:r}})({input:t?.loginMethodsAndOrder}),_=t?.intl?.defaultCountry??"US",{chains:W,defaultChain:M}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:o}){let a;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&&o&&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`."),a=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=O.find((t=>t.id===e.id)),r=t?.rpcUrls.privy?.http[0];return r?I(e,r):e}))}else a=O.concat(e??[]);let n=t?a[0]:w,i=r??n;if(!a.find((e=>e.id===i.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:a,defaultChain:i}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),F=!!t?.defaultChain,D=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,R=!(e.enforceWalletUis??1);if(b=e.legacyWalletUiConfig??1?D?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??R:R,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==b)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:H,...N}=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??A.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:L({backgroundTheme:t?.appearance?.theme??A.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??A.appearance.accentColor}),loginGroupPriority:k?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:U,walletChainType:t?.appearance?.walletChainType??"ethereum-only"},loginMethods:{wallet:i,email:o,sms:a,passkey:n,google:l,twitter:s,discord:p,github:m,spotify:u,instagram:h,tiktok:c,linkedin:d,apple:f,farcaster:g,telegram:y},loginMethodsAndOrder:T,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??A.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??A.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??A.rpcConfig.rpcTimeouts},chains:W,defaultChain:M,intl:{defaultCountry:_},shouldEnforceDefaultChainOnConnect:F,captchaEnabled:e.captchaEnabled??A.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??A.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:S},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof H?{requireUserOwnedRecoveryOnCreate:H}:{},...D?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...N,noPromptOnSignature:b,showWalletUIs:t?.embeddedWallets?.showWalletUIs},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:D?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??A._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??A.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??A.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??A.fundingMethodConfig.moonpay.useSandbox}}}}let R={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 H=D(R,void 0,!1);let N=o.createContext({appConfig:H,isServerConfigLoaded:!1});const K=o.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.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_APP_CONFIG=H,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=O,exports.DEFAULT_SUPPORTED_CHAIN_IDS=U,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.OAUTH_DISABLE_SIGNUP_KEY="privy:oauth_disable_signup",exports.PrivyAppConfigProvider=({children:e,legacyCreateEmbeddedWalletFlag:t,client:a,clientConfig:n})=>{let[i,l]=o.useState(null),s=o.useMemo((()=>D(i??R,n,!!i)),[i,n]);return o.useEffect((()=>{if(!i)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:a,defaultChain:n,externalWallets:i,...l}=e;return{...l,...o?{additionalChains:o.map((e=>e.id))}:void 0,...a?{supportedChains:a.map((e=>e.id))}:void 0,...n?{defaultChain:n.id}:void 0,...i?{walletConnect:i.walletConnect,coinbaseWallet:i.coinbaseWallet,solana:{connectors:i.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(n,t),r=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let t,a=0;a<e.length;a++)r=Math.imul(r^(t=e.charCodeAt(a)),2654435761),o=Math.imul(o^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),4294967296*(2097151&(o=Math.imul(o^o>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)}(JSON.stringify(e)).toString(),o=`privy:sent:${i.id}:${r}`;localStorage.getItem(o)||(a.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(o,"t"))}),[n,t,i]),o.useEffect((()=>{i||(async()=>{try{let e=await a.getServerConfig();e.customApiUrl&&a.updateApiUrl(e.customApiUrl),l(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),r.jsx(N.Provider,{value:{appConfig:s,isServerConfigLoaded:!!i},children:e})},exports.REFRESH_TOKEN_COOKIE_KEY="privy-refresh-token",exports.REFRESH_TOKEN_STORAGE_KEY="privy:refresh_token",exports.SESSION_COOKIE_KEY="privy-session",exports.STATE_CODE_KEY="privy:state_code",exports.TOKEN_COOKIE_KEY="privy-token",exports.TOKEN_STORAGE_KEY="privy:token",exports.UseWalletsContext=K,exports.VERSION="1.92.1-beta-20241018171533",exports.WALLET_PROXY_TIMEOUT=3e4,exports.addPrivyRpcToChain=I,exports.addRpcUrlOverrideToChain=function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}},exports.addToDefaultChains=function(e){let t=e.filter((e=>!U.has(e.id)));return O.concat(t)},exports.arbitrum=u,exports.arbitrumSepolia=h,exports.avalanche=d,exports.avalancheFuji=m,exports.base=f,exports.baseSepolia=g,exports.celo=y,exports.clamp=function(e,{min:t,max:r}){return Math.min(Math.max(e,t),r)},exports.constructURL=(e,t,r={},o={})=>{let a=new URL(t,e);for(let[e,t]of Object.entries(r))void 0!==t&&a.searchParams.set(e,t);let n=Object.entries(o);if(n.length>0){let e=new URLSearchParams;for(let[t,r]of n)e.append(t,r);a.hash=e.toString()}return a.href},exports.convert1dTo2dArray=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},exports.detectInjectedConnectors=async function({store:e,walletList:t,externalWalletConfig:r,walletChainType:o,timeout:a=3e3}){let n=!1,s=window;return new Promise((p=>{function c(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",c);let a=e.getProviders();console.debug("Detected injected providers:",a.map((e=>e.info)));let s=[];for(let e of a)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||"solana-only"===o&&"app.phantom"===e.info.rdns||s.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});if("solana-only"!==o)for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let e of t.providers)e&&r.push(e);return r.push(e.ethereum),r}()){let t=i(e);if(!a.some((e=>e.info.name===t))){if(l(e,!0)&&!s.find((e=>"metamask"===e.type))){s.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!s.find((e=>"phantom"===e.type))){s.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!s.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==r.coinbaseWallet?.connectionOptions))){s.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}s.find((e=>"unknown_browser_extension"===e.type))||s.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}p(s)}s.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout((()=>{c()}),a))}))},exports.formatChainIdToCAIP2=function(e){return`eip155:${String(Number(e))}`},exports.formatSolanaWalletAddress=(e,t=3,r=4)=>s(e,t,r,"solana"),exports.formatWalletAddress=s,exports.generateTypedDataWithDomainType=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map((([e,r])=>{if(null!=r&&"string"==typeof e&&e in t)return{name:e,type:t[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:r}}},exports.getBlockExplorer=(e,r)=>{let o=Number(e),a=r.find((e=>e.id===o));if(!a)throw new t.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return a.blockExplorers?.default.url},exports.getGuestCredentialStorageKey=e=>`privy:guest:${e}`,exports.getJsonRpcEndpoint=(e,r,o,a)=>{let n=Number(e),i=r.find((e=>e.id===n));if(!i)throw new t.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return c(i,o,a)},exports.getJsonRpcEndpointFromChain=c,exports.getJsonRpcProvider=(r,o,a,n)=>{let i=Number(r),l=o.find((e=>e.id===i));if(!l)throw new t.PrivyConnectorError(`Unsupported chainId ${r}`,4901);return new e.StaticJsonRpcProvider(l.rpcUrls.privyWalletOverride&&l.rpcUrls.privyWalletOverride.http[0]?l.rpcUrls.privyWalletOverride.http[0]:a.rpcUrls&&a.rpcUrls[i]?a.rpcUrls[i]:l.rpcUrls.privy?.http[0]?{url:l.rpcUrls.privy.http[0],headers:{"privy-app-id":n.appId}}:l.rpcUrls.public?.http[0]?l.rpcUrls.public.http[0]:l.rpcUrls.default?.http[0])},exports.getPrivyWalletKey=e=>`privy:wallet:${e}`,exports.getProviderAccessTokenStorageKey=e=>`privy:cross-app:${e}`,exports.invokeUntilSettled=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise((async(a,n)=>{let i=!1,l=0;for(;!i&&l<o;){if(t.abortSignal?.aborted)return;e().then((e=>{i=!0,a(e)}),((...e)=>{i=!0,n(...e)})),l+=1,await p(r)}i||n(Error("Exceeded max attempts before resolving function"))}))},exports.isCoinbaseWalletInstalled=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0;return!1},exports.isPhantomInstalled=()=>{if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom&&e?.phantom?.ethereum?.chainId)return!0}return!1},exports.linea=b,exports.mainnet=w,exports.optimism=v,exports.optimismSepolia=C,exports.pollForResult=function(e,{interval:t=100,timeout:r=5e3}={}){return new Promise(((o,a)=>{let n,i=0,l=()=>{i>=r?a("Max attempts reached without result"):(n=e(),i+=t,null==n?setTimeout(l,t):o(n))};l()}))},exports.polygon=E,exports.polygonAmoy=x,exports.sepolia=k,exports.sleep=p,exports.splitAtIndex=(e,t)=>{let r=[],o=[];for(let[a,n]of e.entries())a<t?r.push(n):o.push(n);return[r,o]},exports.stripEmoji=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),exports.toHex=e=>"string"==typeof e?e:"0x"+e.toString(16),exports.useAppConfig=()=>{let{appConfig:e}=o.useContext(N);return e},exports.useIsServerConfigLoaded=()=>{let{isServerConfigLoaded:e}=o.useContext(N);return e},exports.useWallets=function(){let e=o.useContext(K);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e},exports.validateEmail=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),exports.zora=S;
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { MouseEvent } from 'react';
3
- import { C as Chain, W as WalletConnector, B as BaseConnectedEthereumWallet, a as RpcConfig, P as PrivyProxyProvider, E as Embedded1193Provider, b as WalletClientType, c as ConnectedWalletMetadata, d as ConnectorType, e as WalletListEntry, f as ExternalWalletsConfig, g as BaseConnectedWallet, S as SolanaWalletConnector, h as EIP1193Provider, U as User, O as OAuthTokens, i as OAuthProviderType, M as MoonpaySignRequest, j as MoonpaySignResponse, k as SmartWalletConfig, l as PrivyServerConfig, m as PrivyFarcasterSignerInitResponse, L as LoginMethod, n as SiweWalletMetadata, T as TelegramAuthResult, o as OAuthUserInfo, p as PrivyClientConfig, q as ConnectWalletModalOptions, r as LoginModalOptions, s as CreateWalletOptions, t as Wallet, u as SetWalletRecoveryOptions, v as SignMessageModalUIOptions, w as SignTypedDataParams, x as MfaMethod, y as UnsignedTransactionRequest, z as SendTransactionModalUIOptions, F as FundWalletConfig, A as TransactionReceipt, D as SupportedSolanaTransaction, G as SolanaTransactionReceipt, H as ConnectedWallet, I as PrivyIframeErrorTypesType, J as OAuthFlowState, K as LoginWithCode, N as OtpFlowState, Q as PasskeyFlowState, V as SiweFlowState, X as UnsignedTransactionRequestWithChainId, Y as CustomAuthFlowState } from './types.js';
4
- export { ag as Apple, aq as AppleOAuthWithMetadata, Z as AsExternalProvider, aF as ConnectedSolanaWallet, ay as ContractUIOptions, aj as CrossAppAccount, at as CrossAppAccountWithMetadata, ad as Discord, am as DiscordOAuthWithMetadata, av as Email, a8 as EmailWithMetadata, aC as Farcaster, ar as FarcasterWithMetadata, ae as Github, an as GithubOAuthWithMetadata, ab as Google, ak as GoogleOAuthWithMetadata, af as LinkedIn, ap as LinkedInOAuthWithMetadata, aE as LoginMethodOrderOption, $ as MessageTypes, a1 as MoonpayConfig, a2 as MoonpayCurrencyCode, aA as MoonpayFundingConfig, a3 as MoonpayPaymentMethod, az as NativeFundingConfig, a7 as NonEmptyArray, aD as Passkey, au as PasskeyWithMetadata, aw as Phone, a9 as PhoneWithMetadata, aB as PriceDisplayOptions, a4 as Quantity, a6 as SolanaCluster, a0 as SolanaFundingConfig, ai as Telegram, as as TelegramWithMetadata, ah as Tiktok, ao as TiktokOAuthWithMetadata, a5 as TransactionLog, ax as TransactionUIOptions, ac as Twitter, al as TwitterOAuthWithMetadata, _ as TypedMessage, aa as WalletWithMetadata } from './types.js';
3
+ import { C as Chain, W as WalletConnector, B as BaseConnectedEthereumWallet, a as RpcConfig, P as PrivyProxyProvider, E as Embedded1193Provider, b as WalletClientType, c as ConnectedWalletMetadata, d as ConnectorType, e as WalletListEntry, f as ExternalWalletsConfig, g as BaseConnectedWallet, S as SolanaWalletConnector, h as EIP1193Provider, U as User, O as OAuthTokens, i as OAuthProviderType, M as MoonpaySignRequest, j as MoonpaySignResponse, k as SmartWalletConfig, l as PrivyServerConfig, m as PrivyFarcasterSignerInitResponse, L as LoginMethod, n as SiweWalletMetadata, T as TelegramAuthResult, o as OAuthUserInfo, p as PrivyClientConfig, q as ConnectWalletModalOptions, r as LoginModalOptions, s as CreateWalletOptions, t as Wallet, u as SetWalletRecoveryOptions, v as SignMessageModalUIOptions, w as SignTypedDataParams, x as MfaMethod, y as UnsignedTransactionRequest, z as SendTransactionModalUIOptions, F as FundWalletConfig, A as TransactionReceipt, D as SupportedSolanaTransaction, G as SolanaTransactionReceipt, H as ConnectedWallet, I as PrivyIframeErrorTypesType, J as OAuthFlowState, K as LoginWithCode, N as OtpFlowState, Q as PasskeyFlowState, V as SiweFlowState, X as UnsignedTransactionRequestWithChainId, Y as CustomAuthFlowState } from './types-B8PCl2VL.js';
4
+ export { ag as Apple, aq as AppleOAuthWithMetadata, Z as AsExternalProvider, aF as ConnectedSolanaWallet, ay as ContractUIOptions, aj as CrossAppAccount, at as CrossAppAccountWithMetadata, ad as Discord, am as DiscordOAuthWithMetadata, av as Email, a8 as EmailWithMetadata, aC as Farcaster, ar as FarcasterWithMetadata, ae as Github, an as GithubOAuthWithMetadata, ab as Google, ak as GoogleOAuthWithMetadata, af as LinkedIn, ap as LinkedInOAuthWithMetadata, aE as LoginMethodOrderOption, $ as MessageTypes, a1 as MoonpayConfig, a2 as MoonpayCurrencyCode, aA as MoonpayFundingConfig, a3 as MoonpayPaymentMethod, az as NativeFundingConfig, a7 as NonEmptyArray, aD as Passkey, au as PasskeyWithMetadata, aw as Phone, a9 as PhoneWithMetadata, aB as PriceDisplayOptions, a4 as Quantity, a6 as SolanaCluster, a0 as SolanaFundingConfig, ai as Telegram, as as TelegramWithMetadata, ah as Tiktok, ao as TiktokOAuthWithMetadata, a5 as TransactionLog, ax as TransactionUIOptions, ac as Twitter, al as TwitterOAuthWithMetadata, _ as TypedMessage, aa as WalletWithMetadata } from './types-B8PCl2VL.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { TurnstileProps } from '@marsidev/react-turnstile';
7
7
  import EventEmitter from 'eventemitter3';
@@ -18,8 +18,8 @@ import { Address, Hex } from 'viem';
18
18
  import { SendEip712TransactionParameters } from 'viem/zksync';
19
19
  import { CustomMetadataType, SmartWalletType, PrivyCoinbaseOnRampInitInput, PrivyCoinbaseOnRampInitResponse, PrivyCoinbaseOnRampStatusResponse } from '@privy-io/public-api';
20
20
  import { FetchOptions } from 'ofetch';
21
- import { P as PrivyEvents } from './solana.d2.ts';
22
- export { C as CallbackError, a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './solana.d2.ts';
21
+ import { P as PrivyEvents } from './solana-Du0tGZK-.js';
22
+ export { C as CallbackError, a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './solana-Du0tGZK-.js';
23
23
  import '@metamask/eth-sig-util';
24
24
  import '@privy-io/js-sdk-core';
25
25
 
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { MouseEvent } from 'react';
3
- import { C as Chain, W as WalletConnector, B as BaseConnectedEthereumWallet, a as RpcConfig, P as PrivyProxyProvider, E as Embedded1193Provider, b as WalletClientType, c as ConnectedWalletMetadata, d as ConnectorType, e as WalletListEntry, f as ExternalWalletsConfig, g as BaseConnectedWallet, S as SolanaWalletConnector, h as EIP1193Provider, U as User, O as OAuthTokens, i as OAuthProviderType, M as MoonpaySignRequest, j as MoonpaySignResponse, k as SmartWalletConfig, l as PrivyServerConfig, m as PrivyFarcasterSignerInitResponse, L as LoginMethod, n as SiweWalletMetadata, T as TelegramAuthResult, o as OAuthUserInfo, p as PrivyClientConfig, q as ConnectWalletModalOptions, r as LoginModalOptions, s as CreateWalletOptions, t as Wallet, u as SetWalletRecoveryOptions, v as SignMessageModalUIOptions, w as SignTypedDataParams, x as MfaMethod, y as UnsignedTransactionRequest, z as SendTransactionModalUIOptions, F as FundWalletConfig, A as TransactionReceipt, D as SupportedSolanaTransaction, G as SolanaTransactionReceipt, H as ConnectedWallet, I as PrivyIframeErrorTypesType, J as OAuthFlowState, K as LoginWithCode, N as OtpFlowState, Q as PasskeyFlowState, V as SiweFlowState, X as UnsignedTransactionRequestWithChainId, Y as CustomAuthFlowState } from './types.js';
4
- export { ag as Apple, aq as AppleOAuthWithMetadata, Z as AsExternalProvider, aF as ConnectedSolanaWallet, ay as ContractUIOptions, aj as CrossAppAccount, at as CrossAppAccountWithMetadata, ad as Discord, am as DiscordOAuthWithMetadata, av as Email, a8 as EmailWithMetadata, aC as Farcaster, ar as FarcasterWithMetadata, ae as Github, an as GithubOAuthWithMetadata, ab as Google, ak as GoogleOAuthWithMetadata, af as LinkedIn, ap as LinkedInOAuthWithMetadata, aE as LoginMethodOrderOption, $ as MessageTypes, a1 as MoonpayConfig, a2 as MoonpayCurrencyCode, aA as MoonpayFundingConfig, a3 as MoonpayPaymentMethod, az as NativeFundingConfig, a7 as NonEmptyArray, aD as Passkey, au as PasskeyWithMetadata, aw as Phone, a9 as PhoneWithMetadata, aB as PriceDisplayOptions, a4 as Quantity, a6 as SolanaCluster, a0 as SolanaFundingConfig, ai as Telegram, as as TelegramWithMetadata, ah as Tiktok, ao as TiktokOAuthWithMetadata, a5 as TransactionLog, ax as TransactionUIOptions, ac as Twitter, al as TwitterOAuthWithMetadata, _ as TypedMessage, aa as WalletWithMetadata } from './types.js';
3
+ import { C as Chain, W as WalletConnector, B as BaseConnectedEthereumWallet, a as RpcConfig, P as PrivyProxyProvider, E as Embedded1193Provider, b as WalletClientType, c as ConnectedWalletMetadata, d as ConnectorType, e as WalletListEntry, f as ExternalWalletsConfig, g as BaseConnectedWallet, S as SolanaWalletConnector, h as EIP1193Provider, U as User, O as OAuthTokens, i as OAuthProviderType, M as MoonpaySignRequest, j as MoonpaySignResponse, k as SmartWalletConfig, l as PrivyServerConfig, m as PrivyFarcasterSignerInitResponse, L as LoginMethod, n as SiweWalletMetadata, T as TelegramAuthResult, o as OAuthUserInfo, p as PrivyClientConfig, q as ConnectWalletModalOptions, r as LoginModalOptions, s as CreateWalletOptions, t as Wallet, u as SetWalletRecoveryOptions, v as SignMessageModalUIOptions, w as SignTypedDataParams, x as MfaMethod, y as UnsignedTransactionRequest, z as SendTransactionModalUIOptions, F as FundWalletConfig, A as TransactionReceipt, D as SupportedSolanaTransaction, G as SolanaTransactionReceipt, H as ConnectedWallet, I as PrivyIframeErrorTypesType, J as OAuthFlowState, K as LoginWithCode, N as OtpFlowState, Q as PasskeyFlowState, V as SiweFlowState, X as UnsignedTransactionRequestWithChainId, Y as CustomAuthFlowState } from './types-B8PCl2VL.js';
4
+ export { ag as Apple, aq as AppleOAuthWithMetadata, Z as AsExternalProvider, aF as ConnectedSolanaWallet, ay as ContractUIOptions, aj as CrossAppAccount, at as CrossAppAccountWithMetadata, ad as Discord, am as DiscordOAuthWithMetadata, av as Email, a8 as EmailWithMetadata, aC as Farcaster, ar as FarcasterWithMetadata, ae as Github, an as GithubOAuthWithMetadata, ab as Google, ak as GoogleOAuthWithMetadata, af as LinkedIn, ap as LinkedInOAuthWithMetadata, aE as LoginMethodOrderOption, $ as MessageTypes, a1 as MoonpayConfig, a2 as MoonpayCurrencyCode, aA as MoonpayFundingConfig, a3 as MoonpayPaymentMethod, az as NativeFundingConfig, a7 as NonEmptyArray, aD as Passkey, au as PasskeyWithMetadata, aw as Phone, a9 as PhoneWithMetadata, aB as PriceDisplayOptions, a4 as Quantity, a6 as SolanaCluster, a0 as SolanaFundingConfig, ai as Telegram, as as TelegramWithMetadata, ah as Tiktok, ao as TiktokOAuthWithMetadata, a5 as TransactionLog, ax as TransactionUIOptions, ac as Twitter, al as TwitterOAuthWithMetadata, _ as TypedMessage, aa as WalletWithMetadata } from './types-B8PCl2VL.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { TurnstileProps } from '@marsidev/react-turnstile';
7
7
  import EventEmitter from 'eventemitter3';
@@ -18,8 +18,8 @@ import { Address, Hex } from 'viem';
18
18
  import { SendEip712TransactionParameters } from 'viem/zksync';
19
19
  import { CustomMetadataType, SmartWalletType, PrivyCoinbaseOnRampInitInput, PrivyCoinbaseOnRampInitResponse, PrivyCoinbaseOnRampStatusResponse } from '@privy-io/public-api';
20
20
  import { FetchOptions } from 'ofetch';
21
- import { P as PrivyEvents } from './solana.d2.ts';
22
- export { C as CallbackError, a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './solana.d2.ts';
21
+ import { P as PrivyEvents } from './solana-Du0tGZK-.js';
22
+ export { C as CallbackError, a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './solana-Du0tGZK-.js';
23
23
  import '@metamask/eth-sig-util';
24
24
  import '@privy-io/js-sdk-core';
25
25
 
@@ -1,4 +1,4 @@
1
- import { aG as PrivyErrorCode, U as User, L as LoginMethod, aH as LinkedAccountWithMetadata, O as OAuthTokens, g as BaseConnectedWallet, t as Wallet, x as MfaMethod, aI as UserRecoveryMethod, G as SolanaTransactionReceipt, C as Chain, aJ as FundingMethod, a6 as SolanaCluster, aF as ConnectedSolanaWallet, a0 as SolanaFundingConfig } from './types.js';
1
+ import { aG as PrivyErrorCode, U as User, L as LoginMethod, aH as LinkedAccountWithMetadata, O as OAuthTokens, g as BaseConnectedWallet, t as Wallet, x as MfaMethod, aI as UserRecoveryMethod, G as SolanaTransactionReceipt, C as Chain, aJ as FundingMethod, a6 as SolanaCluster, aF as ConnectedSolanaWallet, a0 as SolanaFundingConfig } from './types-B8PCl2VL.js';
2
2
  import { TransactionResponse } from '@ethersproject/providers';
3
3
 
4
4
  /**
@@ -0,0 +1,352 @@
1
+ import { aG as PrivyErrorCode, U as User, L as LoginMethod, aH as LinkedAccountWithMetadata, O as OAuthTokens, g as BaseConnectedWallet, t as Wallet, x as MfaMethod, aI as UserRecoveryMethod, G as SolanaTransactionReceipt, C as Chain, aJ as FundingMethod, a6 as SolanaCluster, aF as ConnectedSolanaWallet, a0 as SolanaFundingConfig } from './types-B8PCl2VL.js';
2
+ import { TransactionResponse } from '@ethersproject/providers';
3
+
4
+ /**
5
+ * `CallbackError` optionally includes a second parameter with further error details.
6
+ */
7
+ type CallbackError<Details extends Record<string, any> | undefined = undefined> = Details extends Record<string, any> ? (error: PrivyErrorCode, details: Details) => void : (error: PrivyErrorCode) => void;
8
+ interface PrivyEvents {
9
+ login: {
10
+ /**
11
+ * Callback that will execute once a `login` flow successfully completes.
12
+ * - If `config.embeddedWallets.createOnLogin` is set to 'off' or a wallet creation flow is not applicable,
13
+ * this will run after the user successfully authenticates.
14
+ * - If `config.embeddedWallets.createOnLogin` is set to 'users-without-wallets' or 'all-users',
15
+ * this will run after the user successfully authenticates _and_ creates their wallet (if applicable).
16
+ * - If a user is already authenticated, this will run immediately and the `wasAlreadyAuthenticated` flag will be set to `true`.
17
+ *
18
+ * @param user {@link User} the `user` oject corresponding to the authenticated user
19
+ * @param isNewUser {boolean} boolean flag indicating if this is the user's first time logging in to your app
20
+ * @param wasAlreadyAuthenticated {boolean} - boolean flag indicating whether the user entered the application already authenticated
21
+ * @param loginMethod {string} - the method used by the user to login
22
+ * @param loginAccount - the account corresponding to the loginMethod used
23
+ */
24
+ onComplete?: (user: User, isNewUser: boolean, wasAlreadyAuthenticated: boolean, loginMethod: LoginMethod | null, loginAccount: LinkedAccountWithMetadata | null) => void;
25
+ /**
26
+ * @experimental
27
+ *
28
+ * Callback that will execute once a successful OAuth login flow completes.
29
+ * This will only run in the case of an OAuth login flow.
30
+ *
31
+ * This will always be called before `onComplete` in the case of an OAuth login flow.
32
+ * If you will be doing anything after the user is logged in (e.g. sending data to your API or redirecting to an authenticated route), you should wait for `onComplete` to run.
33
+ *
34
+ * @param oAuthTokens {@link OAuthTokens} - the OAuth tokens returned from the OAuth provider
35
+ */
36
+ onOAuthLoginComplete?: (oAuthTokens: OAuthTokens) => void;
37
+ /**
38
+ * Callback that will execute in the case of a non-successful login.
39
+ *
40
+ * @param error {@link PrivyErrorCode} - the corresponding error code
41
+ *
42
+ */
43
+ onError?: CallbackError;
44
+ };
45
+ logout: {
46
+ /**
47
+ * Callback that will execute when a user successfully logs out.
48
+ */
49
+ onSuccess?: () => void;
50
+ };
51
+ connectWallet: {
52
+ /**
53
+ * Callback that will execute once a successful `connectWallet` completes.
54
+ * This will not run in the case of a wallet-based authentication or link flow.
55
+ *
56
+ * @param wallet {@link BaseConnectedWallet} the `wallet` object correspending to the connection
57
+ */
58
+ onSuccess?: (wallet: BaseConnectedWallet) => void;
59
+ /**
60
+ * Callback that will execute in the case of a non-successful wallet connection.
61
+ *
62
+ * @param error {@link PrivyErrorCode} - the corresponding error code
63
+ */
64
+ onError?: CallbackError;
65
+ };
66
+ createWallet: {
67
+ /**
68
+ * Callback that will execute once on a successful embedded wallet creation.
69
+ * This will run when `createWallet` is called manually, or when `config.embeddedWallets.createOnLogin` triggers
70
+ * an automatic wallet creation.
71
+ *
72
+ * @param wallet {@link BaseConnectedWallet}- the created `wallet` object
73
+ *
74
+ */
75
+ onSuccess?: (wallet: Wallet) => void;
76
+ /**
77
+ * Callback that will execute in the case of a non-successful wallet creation.
78
+ *
79
+ * @param error {@link PrivyErrorCode} - the corresponding error code
80
+ *
81
+ */
82
+ onError?: CallbackError;
83
+ };
84
+ linkAccount: {
85
+ /**
86
+ * Callback that will execute once on a successful linking of a new account/login method.
87
+ * This will run when any of the 'link' methods are called manually.
88
+ * @param user {@link User}- the user the account was linked to
89
+ * @param linkMethod {@link LoginMethod}- the type of linked account
90
+ * @param linkedAccount - the newly linked account
91
+ */
92
+ onSuccess?: (user: User, linkMethod: LoginMethod, linkedAccount: LinkedAccountWithMetadata) => void;
93
+ /**
94
+ * Callback that will execute in the case of a non-successful account linking.
95
+ *
96
+ * @param error {PrivyErrorCode} - the corresponding error code
97
+ * @param details.linkMethod {LoginMethod} - the type of (attempted) linked account
98
+ *
99
+ */
100
+ onError?: CallbackError<{
101
+ linkMethod: LoginMethod;
102
+ }>;
103
+ };
104
+ update: {
105
+ /**
106
+ * Callback that will execute once on a successful updating of an account.
107
+ * This will run when any of the 'updateAccount' methods are called manually.
108
+ * @param user {@link User}- the user the account was linked to
109
+ * @param updateMethod {@link LoginMethod}- the type of updated account
110
+ * @param updatedAccount - the newly updated account
111
+ */
112
+ onSuccess?: (user: User, updateMethod: LoginMethod, updatedAccount: LinkedAccountWithMetadata) => void;
113
+ /**
114
+ * Callback that will execute in the case of a non-successful account linking.
115
+ *
116
+ * @param error {PrivyErrorCode} - the corresponding error code
117
+ * @param details.linkMethod {LoginMethod} - the type of (attempted) linked account
118
+ *
119
+ */
120
+ onError?: CallbackError<{
121
+ linkMethod: LoginMethod;
122
+ }>;
123
+ };
124
+ configureMfa: {
125
+ /**
126
+ * Callback that will execute when MFA is required to complete a given action.
127
+ * @param mfaMethods {@link MfaMethod[]} - List of MFA methods that the user can choose from
128
+ */
129
+ onMfaRequired: (mfaMethods: MfaMethod[]) => void;
130
+ };
131
+ setWalletPassword: {
132
+ /**
133
+ * Callback that will execute once a successful `setWalletPassword` completes.
134
+ * @param wallet {@link Wallet}- the `wallet` object that the password was set for
135
+ */
136
+ onSuccess?: (wallet: Wallet) => void;
137
+ /**
138
+ * Callback that will execute in the case of a non-successful setWalletPassword.
139
+ *
140
+ * @param error {PrivyErrorCode} - the corresponding error code
141
+ */
142
+ onError?: CallbackError;
143
+ };
144
+ setWalletRecovery: {
145
+ /**
146
+ * Callback that will execute once a successful `setWalletRecovery` completes.
147
+ * @param wallet {@link Wallet}- the `walle]et` object that the recovery was set for
148
+ */
149
+ onSuccess?: (method: UserRecoveryMethod, wallet: Wallet) => void;
150
+ /**
151
+ * Callback that will execute in the case of a non-successful setWalletRecovery.
152
+ *
153
+ * @param error {PrivyErrorCode} - the corresponding error code
154
+ */
155
+ onError?: CallbackError;
156
+ };
157
+ signMessage: {
158
+ /**
159
+ * Callback that will execute once a successful `signMessage` completes.
160
+ * This will not run in the case of a wallet-based authentication or link flow.
161
+ * @param signature - the signature (type string) of the embedded wallet used to sign message
162
+ */
163
+ onSuccess?: (signature: string) => void;
164
+ /**
165
+ * Callback that will execute in the case of a non-successful signMessage.
166
+ *
167
+ * @param error {@link PrivyErrorCode} - the corresponding error code
168
+ * */
169
+ onError?: CallbackError;
170
+ };
171
+ signTypedData: {
172
+ /**
173
+ * Callback that will execute once a successful `signTypedData` completes.
174
+ * @param signature - the signature (type string) of the embedded wallet used to sign
175
+ */
176
+ onSuccess?: (signature: string) => void;
177
+ /**
178
+ * Callback that will execute in the case of a non-successful signTypedData.
179
+ *
180
+ * @param error {@link PrivyErrorCode} - the corresponding error code
181
+ * */
182
+ onError?: CallbackError;
183
+ };
184
+ sendTransaction: {
185
+ /**
186
+ * Callback that will execute once a successful `sendTransaction` completes.
187
+ * This will not run in the case of a wallet-based authentication or link flow.
188
+ * @param response - the response (type TransactionResponse https://docs.ethers.org/v5/api/providers/types/#providers-TransactionResponse) from the successful transaction
189
+ */
190
+ onSuccess?: (response: TransactionResponse) => void;
191
+ /**
192
+ * Callback that will execute in the case of a non-successful sendTransaction.
193
+ *
194
+ * @param error {@link PrivyErrorCode} - the corresponding error code
195
+ * */
196
+ onError?: CallbackError;
197
+ };
198
+ sendSolanaTransaction: {
199
+ /**
200
+ * Callback that will execute once a successful `sendSolanaTransaction` completes.
201
+ * This will not run in the case of a wallet-based authentication or link flow.
202
+ * @param response - the response {@link https://solana-labs.github.io/solana-web3.js/types/ParsedTransactionMeta.html SolanaTransactionReceipt} from the successful transaction
203
+ */
204
+ onSuccess?: (response: SolanaTransactionReceipt) => void;
205
+ /**
206
+ * Callback that will execute in the case of a non-successful sendTransaction.
207
+ *
208
+ * @param error {@link PrivyErrorCode} - the corresponding error code
209
+ * */
210
+ onError?: CallbackError;
211
+ };
212
+ accessToken: {
213
+ /**
214
+ * Callback that will execute when a user's access token is granted.
215
+ * @param accessToken - The user's access token
216
+ */
217
+ onAccessTokenGranted: (accessToken: string) => void;
218
+ /**
219
+ * Callback that will execute when a user's access token is removed.
220
+ */
221
+ onAccessTokenRemoved: () => void;
222
+ };
223
+ oAuthAuthorization: {
224
+ /**
225
+ * Callback that will execute when a user successfully authorizes an OAuth flow.
226
+ *
227
+ * @param oAuthTokens {@link OAuthTokens} - the OAuth tokens returned from the OAuth provider:
228
+ * @param oAuthTokens.provider - {string} The OAuth provider type.
229
+ * @param oAuthTokens.accessToken - {string} The OAuth access token.
230
+ * @param oAuthTokens.accessTokenExpiresInSeconds - {number} (optional) The number of seconds until the OAuth access token expires.
231
+ * @param oAuthTokens.refreshToken - {string} (optional) The OAuth refresh token.
232
+ * @param oAuthTokens.refreshTokenExpiresInSeconds - {number} (optional) The number of seconds until the OAuth refresh token expires.
233
+ * if the refresh token is present and this field is undefined, it is assumed
234
+ * that the refresh token does not have an expiration date.
235
+ * @param oAuthTokens.scopes - {string[]} (optional) The list of OAuth scopes the access token is approved for.
236
+ *
237
+ * @param o.user {@link User} (optional) The list of OAuth scopes the access token is approved for.
238
+ */
239
+ onOAuthTokenGrant: (oAuthTokens: OAuthTokens, o: {
240
+ user: User;
241
+ }) => void;
242
+ };
243
+ fundWallet: {
244
+ /**
245
+ * Callback that will execute when a funding flow is exited. This fires when a user closes a funding flow modal, for any reason.
246
+ *
247
+ * @param fundingMethod {@link FundingMethod} The funding method associated with the flow at time of exit. If the user had not yet selected
248
+ * @param balance {@link BigNumber} The value for the funded wallet at the point of user exit.
249
+ * a recovery method, this will be null.
250
+ */
251
+ onUserExited?: (o: {
252
+ address: string;
253
+ chain: Chain;
254
+ fundingMethod: FundingMethod | 'manual' | null;
255
+ balance: bigint | undefined;
256
+ }) => void;
257
+ };
258
+ fundSolanaWallet: {
259
+ /**
260
+ * Callback that will execute when a funding flow is exited. This fires when a user closes a funding flow modal, for any reason.
261
+ *
262
+ * @param fundingMethod {@link FundingMethod} The funding method associated with the flow at time of exit. If the user had not yet selected
263
+ * @param balance {@link BigNumber} The value for the funded wallet at the point of user exit.
264
+ * a recovery method, this will be null.
265
+ */
266
+ onUserExited?: (o: {
267
+ address: string;
268
+ cluster: SolanaCluster;
269
+ fundingMethod: FundingMethod | 'manual' | null;
270
+ balance: bigint | undefined;
271
+ }) => void;
272
+ };
273
+ customAuth: {
274
+ /**
275
+ * Callback that will execute when Privy successfully exchanges a custom auth JWT for a Privy JWT
276
+ * @param o.user - The Privy user
277
+ */
278
+ onAuthenticated: (o: {
279
+ user: User;
280
+ }) => void;
281
+ /**
282
+ * Callback that will execute when Privy detects a user is logged out from the third-party auth system, and correspondingly logs the user out.
283
+ */
284
+ onUnauthenticated: () => void;
285
+ };
286
+ }
287
+
288
+ /**
289
+ * Hook to create and interact with Solana wallets. This currently only supports an embedded Solana wallet and no
290
+ * external wallets.
291
+ *
292
+ * @returns wallets {ConnectedSolanaWallet[]} an array of connected Solana wallets
293
+ * @returns createWallet {() => Promise<Wallet>} an method to create an embedded Solana wallet.
294
+ */
295
+ interface UseSolanaWalletsInterface {
296
+ /**
297
+ * An array of the connected Solana wallets for the user. Currently, this will only contain the embedded
298
+ * Solana wallet if the user has created one.
299
+ */
300
+ wallets: ConnectedSolanaWallet[];
301
+ /**
302
+ * Method to create an embedded Solana wallet for a user. This method will throw an error if the user already has an
303
+ * embedded Solana or Ethereum wallet. Currently, only embedded Solana wallets with automatic recovery are supported.
304
+ * @returns wallet {Wallet} the Solana linked account for the user.
305
+ */
306
+ createWallet: () => Promise<Wallet>;
307
+ /**
308
+ * Shows the user a Privy modal, from which they can copy their embedded solana wallet's private
309
+ * key for easy export to another wallet client (e.g. Phantom, Backpack). The private key is loaded
310
+ * on an iframe running on a separate domain from your app, meaning your app cannot access it.
311
+ *
312
+ * This method will error if the user is not authenticated or does not have an embedded solana wallet.
313
+ * @param options {@link {address: string}} (optional) wallet address to export the private key for
314
+ * @returns Promise that resolves once the user exits the modal
315
+ */
316
+ exportWallet: (options?: {
317
+ address: string;
318
+ }) => Promise<void>;
319
+ }
320
+ declare const useSolanaWallets: () => UseSolanaWalletsInterface;
321
+
322
+ /**
323
+ * Method to fund a user's wallet via Privy's funding feature by inputting a valid wallet address.
324
+ * You can access the fields and methods documented here via the {@link useFundWallet} hook.
325
+ */
326
+ interface UseFundSolanaWalletInterface {
327
+ /**
328
+ * Prompt the user to go through the funding flow and for a specified wallet.
329
+ *
330
+ * This will open the modal with a prompt for the user to select a funding method (if multiple are enabled).
331
+ *
332
+ * Once the user continues to the funding flow, Privy will display the funding status screen, and wait
333
+ * for the transaction to complete.
334
+ *
335
+ * Note: Even after a successful funding, funds can take a few minutes to arrive in the user's wallet.
336
+ *
337
+ * Privy currently supports funding via external wallets and Moonpay.
338
+ *
339
+ * @param address typed data payload to be signed
340
+ * @param fundWalletConfig {@link SolanaFundingConfig} Funding configuration to specify chain and funding amount (if enabled)
341
+ */
342
+ fundWallet: (address: string, fundWalletConfig?: SolanaFundingConfig) => Promise<void>;
343
+ }
344
+ /**
345
+ * Hook to fund a wallet via Privy's fiat on-ramp integration given the wallet address.
346
+ *
347
+ * @param callbacks.onUserExited {@link PrivyEvents} Callback that will execute when a funding flow is exited. This fires when a user closes a funding flow modal, for any reason.
348
+ * @returns fundWallet - function to on-ramp funds to any given wallet
349
+ */
350
+ declare const useFundWallet: (callbacks?: PrivyEvents["fundSolanaWallet"]) => UseFundSolanaWalletInterface;
351
+
352
+ export { type CallbackError as C, type PrivyEvents as P, type UseSolanaWalletsInterface as U, type UseFundSolanaWalletInterface as a, useFundWallet as b, useSolanaWallets as u };
@@ -1,5 +1,5 @@
1
- export { aF as ConnectedSolanaWallet, S as SolanaAdapterConnector, G as SolanaTransactionReceipt, D as SupportedSolanaTransaction, aK as toSolanaWalletConnectors } from './types.js';
2
- export { a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, b as useFundWallet, u as useSolanaWallets } from './solana.d2.ts';
1
+ export { aF as ConnectedSolanaWallet, S as SolanaAdapterConnector, G as SolanaTransactionReceipt, D as SupportedSolanaTransaction, aK as toSolanaWalletConnectors } from './types-B8PCl2VL.js';
2
+ export { a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, b as useFundWallet, u as useSolanaWallets } from './solana-Du0tGZK-.js';
3
3
  import '@metamask/eth-sig-util';
4
4
  import '@ethersproject/providers';
5
5
  import 'eventemitter3';
@@ -1,5 +1,5 @@
1
- export { aF as ConnectedSolanaWallet, S as SolanaAdapterConnector, G as SolanaTransactionReceipt, D as SupportedSolanaTransaction, aK as toSolanaWalletConnectors } from './types.js';
2
- export { a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, b as useFundWallet, u as useSolanaWallets } from './solana.d2.ts';
1
+ export { aF as ConnectedSolanaWallet, S as SolanaAdapterConnector, G as SolanaTransactionReceipt, D as SupportedSolanaTransaction, aK as toSolanaWalletConnectors } from './types-B8PCl2VL.js';
2
+ export { a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, b as useFundWallet, u as useSolanaWallets } from './solana-Du0tGZK-.js';
3
3
  import '@metamask/eth-sig-util';
4
4
  import '@ethersproject/providers';
5
5
  import 'eventemitter3';
package/dist/dts/ui.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { R as RuntimeLoginOverridableOptions } from './types.js';
2
+ import { R as RuntimeLoginOverridableOptions } from './types-B8PCl2VL.js';
3
3
  import '@metamask/eth-sig-util';
4
4
  import '@ethersproject/providers';
5
5
  import 'eventemitter3';
package/dist/dts/ui.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { R as RuntimeLoginOverridableOptions } from './types.js';
2
+ import { R as RuntimeLoginOverridableOptions } from './types-B8PCl2VL.js';
3
3
  import '@metamask/eth-sig-util';
4
4
  import '@ethersproject/providers';
5
5
  import 'eventemitter3';
@@ -0,0 +1 @@
1
+ import{isHex as E,numberToHex as _,encodeAbiParameters as N,parseAbiParameters as e,createPublicClient as A,http as S,pad as a}from"viem";import{sendRawTransaction as T}from"viem/actions";import{abstractTestnet as R}from"viem/chains";import{n as C,u as t,h as I}from"./privy-context-QVrL4VJ3.mjs";import{jsx as D,jsxs as n}from"react/jsx-runtime";import{useState as L,useEffect as O,useRef as s,useContext as r,createContext as i}from"react";import{z as o,ap as l,b as c}from"./useWallets-CiR4ebYz.mjs";function M({src:E,..._}){return D("img",{src:E,..._,style:{display:"none"}})}var W,m;(W=m||(m={})).LANDING="LANDING",W.CONNECT_OR_CREATE="CONNECT_OR_CREATE",W.AWAITING_CONNECTION="AWAITING_CONNECTION",W.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",W.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",W.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",W.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",W.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",W.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",W.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",W.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",W.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",W.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",W.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",W.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",W.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",W.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",W.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",W.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",W.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",W.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",W.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",W.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",W.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",W.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",W.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",W.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",W.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",W.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",W.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",W.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",W.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",W.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",W.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",W.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",W.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",W.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",W.INSTALL_PHANTOM_SCREEN="INSTALL_PHANTOM_SCREEN",W.PHANTOM_INTERSTITIAL_SCREEN="PHANTOM_INTERSTITIAL_SCREEN",W.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",W.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",W.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",W.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",W.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",W.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",W.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",W.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",W.MOONPAY_PROMPT_SCREEN="MOONPAY_PROMPT_SCREEN",W.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",W.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",W.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",W.CAPTCHA_SCREEN="CAPTCHA_SCREEN",W.ERROR_SCREEN="ERROR_SCREEN",W.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",W.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",W.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN";const G=i({ready:!1,app:l,currentScreen:null,lastScreen:null,navigate:C,navigateBack:C,resetNavigation:C,setModalData:C,onUserCloseViaDialogOrKeybindRef:void 0});let P=[m.LANDING,m.CONNECT_ONLY_LANDING_SCREEN,null];const p=E=>{let _=o(),N=E.authenticated,[e,A]=L(E.initialScreen);O((()=>{N||P.includes(E.initialScreen)||E.setInitialScreen(null)}),[N]);let S=s(null);O((()=>{E.open||(S.current=null)}),[E.open]),O((()=>{S.current=null}),[E.initialScreen]);let a={ready:!!_.id,app:_,data:E.data,setModalData:E.setModalData,currentScreen:E.initialScreen,lastScreen:e,navigate:(_,N=!0)=>{E.setInitialScreen(_),N&&A(E.initialScreen)},navigateBack:()=>{E.setInitialScreen(e)},resetNavigation:()=>{E.setInitialScreen(null),A(null)},onUserCloseViaDialogOrKeybindRef:S};return n(G.Provider,{value:a,children:[("string"==typeof _.appearance.logo||"img"===_.appearance.logo?.type)&&D(M,{src:"string"==typeof _.appearance.logo?_.appearance.logo:_.appearance.logo.props.src}),E.children]})},g=()=>r(G);function d(E){return E?a(_(BigInt(E)),{dir:"left",size:20}):"0x"}function F(){let{noPromptOnSignature:a,openPrivyModal:C,chains:D}=t(),{signTypedData:n}=I(),{setModalData:L}=g(),O=D.find((E=>E.id===R.id));return{sendTransaction:(R,t,I,D,s)=>{t.to=d(t.to);let r=c(((E,_)=>{let N="string"==typeof E?JSON.parse(E):E,e=_.custom?.getEip712Domain?.({...N,chainId:_.id,from:N.from,type:"eip712"});return e.domain.name="zkSync",Object.entries(e.message).forEach((([E,_])=>{"bigint"==typeof _&&(e.message[E]=String(_))})),e})(t,O));return new Promise((async(i,o)=>{a.current=!0,L({connectWallet:{onCompleteNavigateTo:m.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:I.map((N=>({to:d(r.message.to),value:"string"==typeof N.value?E(N.value)?N.value:_(BigInt(N.value)):N.value,data:N.data??"0x",chainId:r.domain.chainId,maxPriorityFeePerGas:BigInt(r.message.maxPriorityFeePerGas),maxFeePerGas:BigInt(r.message.maxFeePerGas),gasLimit:BigInt(r.message.gasLimit),nonce:r.message.nonce}))),rootWallet:{address:R.address},transactingWallet:{address:R.address,walletIndex:null},getIsSponsored:async()=>Number(r.message.paymaster)>0,onConfirm:async()=>{let E=await n(r),a={to:BigInt(r.message.to),value:BigInt(r.message.value),data:r.message.data??void 0,chainId:r.domain.chainId,maxPriorityFeePerGas:BigInt(r.message.maxPriorityFeePerGas),maxFeePerGas:BigInt(r.message.maxFeePerGas),gas:BigInt(r.message.gasLimit),paymaster:d(r.message.paymaster),paymasterInput:r.message.paymasterInput},R=N(e(["bytes","address","bytes[]"]),[E,"0xC894DE2894e2F84C0C2944FDcce9490eC22A92b6",[]]),C={...a,factoryDeps:t.factoryDeps,to:d(r.message.to),chainId:O.id,from:_(BigInt(r.message.from)),customSignature:R,type:"eip712",data:r.message.data,nonce:Number(r.message.nonce)},I=O.serializers?.transaction(C,{r:"0x0",s:"0x0",v:0n}),L=A({chain:O,transport:S(`https://abs-testnet.rpc.privy.systems?privyAppId=${D}`)});return await T(L,{serializedTransaction:I})},onSuccess:E=>i(E.hash),onFailure:o,uiOptions:s}}),C(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{a.current=!1}))}}}function u(E){return E.find((E=>"privy"===E.walletClientType&&"embedded"===E.connectorType&&!E.imported))??null}export{m as M,p as a,F as b,u as g,g as u};