@privy-io/react-auth
Version:
React client for the Privy Auth API
2 lines (1 loc) • 2.61 kB
JavaScript
import{jsx as e}from"react/jsx-runtime";import{useRef as t,useCallback as o}from"react";import{u as r}from"./context-BOoFAPna.mjs";import{u as n,c as i,b as a}from"./internal-context-e-Eni5bG.mjs";import{a as l}from"./events-context-CI0iqAXA.mjs";import{a as c}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{i as s}from"./ConnectWalletView-Ch6TwKX_.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"react-device-detect";import"styled-components";import"./Button-CrJpeX0e.mjs";import"./useActiveWallet-BdFIc7_K.mjs";import"zustand";import"./prepareFundingModalData-CzDMa8gy.mjs";import"eventemitter3";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-3r4yfFNg.mjs";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./Link-DwjLfHwW.mjs";import"./ModalHeader-YP9pLMEP.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./QrCode-C0_lXRph.mjs";import"qrcode";import"./EmailInputForm-B4hjCxRU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./useI18n-fcpgyVzo.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-CpIMiJNF.mjs";import"./index-CJMgUOnw.mjs";const m={component:()=>{let{setWalletConnectionStatus:m,closePrivyModal:p,inProgressAuthFlowRef:u}=n(),{data:d,navigate:C}=c(),j=r(),W=l(),w=d?.externalConnectWallet?.description,h=t(d?.externalConnectWallet?.walletList??j.appearance.walletList),E=t(d?.externalConnectWallet?.walletChainType??j.appearance.walletChainType),f=h.current,v=E.current,x="link"===u.current?void 0:()=>C("LandingScreen");/*#__PURE__*/return e(s,{walletList:f,walletChainType:v,onClose:p,onConnect:o((({connector:e,wallet:t})=>{W("connectWallet","onSuccess",{wallet:t}),m({status:"connected",connectedWallet:t,connector:e,connectError:null,connectRetry:()=>null}),C("ConnectionStatusScreen",!d?.externalConnectWallet?.preSelectedWalletId)}),[m,C,d?.login?.disableSignup,d?.externalConnectWallet?.preSelectedWalletId]),onConnectError:e=>{e instanceof i?(console.warn(e.cause?e.cause:e.message),W("connectWallet","onError",e.privyErrorCode||a.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),W("connectWallet","onError",a.UNKNOWN_CONNECT_WALLET_ERROR))},onBack:x,customDescription:w||"",preSelectedWalletId:d?.externalConnectWallet?.preSelectedWalletId,app:j})},isUnauthenticatedScreem:!0};export{m as AuthenticateWithWalletScreen,m as default};