@privy-io/react-auth 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client.js +1 -1
- package/dist/cjs/config.js +1 -1
- package/dist/cjs/configuration/context.js +1 -1
- package/dist/cjs/connectors/embeddedProvider.js +1 -1
- package/dist/cjs/connectors/ethereum/index.js +1 -1
- package/dist/cjs/connectors/index.js +1 -1
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/embedded-wallets/solana/provider.js +1 -1
- package/dist/cjs/hooks/privy-provider.js +1 -1
- package/dist/cjs/hooks/useMfaEnrollment.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/{privy-provider-BJZXBWyw.js → privy-provider-B8LaAjk_.js} +1 -1
- package/dist/cjs/screens/Funding/ManualTransferScreen.js +1 -1
- package/dist/cjs/screens/MfaScreens/EnrollPasskey.js +1 -1
- package/dist/cjs/screens/MfaScreens/MfaEnrollmentFlowScreen.js +1 -1
- package/dist/dts/farcaster.d.mts +1 -1
- package/dist/dts/farcaster.d.ts +1 -1
- package/dist/dts/index.d.mts +19 -8
- package/dist/dts/index.d.ts +19 -8
- package/dist/dts/smart-wallets.d.mts +1 -1
- package/dist/dts/smart-wallets.d.ts +1 -1
- package/dist/dts/solana.d.mts +4 -4
- package/dist/dts/solana.d.ts +4 -4
- package/dist/dts/{types-DQ7QKE2m.d.mts → types-B-zTuIEL.d.mts} +7 -0
- package/dist/dts/{types-DQ7QKE2m.d.ts → types-B-zTuIEL.d.ts} +7 -0
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/dts/{useSolanaWallets-C61-2PbZ.d.ts → useSolanaWallets-DdM-QdoK.d.mts} +1 -1
- package/dist/dts/{useSolanaWallets-C61-2PbZ.d.mts → useSolanaWallets-DdM-QdoK.d.ts} +1 -1
- package/dist/esm/client.mjs +1 -1
- package/dist/esm/config.mjs +1 -1
- package/dist/esm/configuration/context.mjs +1 -1
- package/dist/esm/connectors/embeddedProvider.mjs +1 -1
- package/dist/esm/connectors/ethereum/index.mjs +1 -1
- package/dist/esm/connectors/index.mjs +1 -1
- package/dist/esm/constants.mjs +1 -1
- package/dist/esm/embedded-wallets/solana/provider.mjs +1 -1
- package/dist/esm/hooks/privy-provider.mjs +1 -1
- package/dist/esm/hooks/useMfaEnrollment.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/{privy-provider-SxHxPcTS.mjs → privy-provider-CuvYT8ML.mjs} +2 -2
- package/dist/esm/screens/Funding/ManualTransferScreen.mjs +1 -1
- package/dist/esm/screens/MfaScreens/EnrollPasskey.mjs +1 -1
- package/dist/esm/screens/MfaScreens/MfaEnrollmentFlowScreen.mjs +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("react"),n=require("@privy-io/js-sdk-core"),s=require("../../components/Button.js"),o=require("../../components/Layouts.js"),i=require("../../components/ModalFooter.js"),a=require("../../components/QrCode.js"),t=require("../../components/embedded-wallets/FundWalletMethodHeader.js"),c=require("../../components/ui/banners/InfoBanner.js"),u=require("../../components/ui/typography/Subtitle.js"),l=require("../../components/ui/typography/Title.js"),d=require("../../components/ui/wallet/WalletInfoCard.js"),q=require("../../configuration/context.js"),h=require("../../hooks/internal-context.js"),j=require("../../hooks/modal-context.js"),m=require("../../hooks/useWalletBalance.js"),p=require("../../hooks/useWallets.js"),g=require("../../lib/funding/analytics.js"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),n=require("@privy-io/js-sdk-core"),s=require("../../components/Button.js"),o=require("../../components/Layouts.js"),i=require("../../components/ModalFooter.js"),a=require("../../components/QrCode.js"),t=require("../../components/embedded-wallets/FundWalletMethodHeader.js"),c=require("../../components/ui/banners/InfoBanner.js"),u=require("../../components/ui/typography/Subtitle.js"),l=require("../../components/ui/typography/Title.js"),d=require("../../components/ui/wallet/WalletInfoCard.js"),q=require("../../configuration/context.js"),h=require("../../hooks/internal-context.js"),j=require("../../hooks/modal-context.js"),m=require("../../hooks/useWalletBalance.js"),p=require("../../hooks/useWallets.js"),g=require("../../lib/funding/analytics.js"),y=require("../../lib/solana/transaction.js"),f=require("../../lib/wallets/actions/getErc20Balance.js"),v=require("../../plugins/context/PrivyPluginContext.js"),C=require("../../plugins/solana-funding/id.js"),b=require("../../svg/blobby.js"),I=require("../../utils/index.js"),S=require("../index.js"),T=require("../../hooks/solana/useSolanaWallets.js");require("styled-components"),require("../../components/Loader.js"),require("../../svg/protected-by-privy.js"),require("../../config.js"),require("../../configuration/defaultClientConfig.js"),require("../../constants.js"),require("../../configuration/login-methods.js"),require("../../configuration/wallets.js"),require("../../connectors/chains/index.js"),require("../../connectors/chains/arbitrum.js"),require("../../connectors/chains/arbitrumSepolia.js"),require("../../connectors/chains/avalanche.js"),require("../../connectors/chains/avalancheFuji.js"),require("../../connectors/chains/base.js"),require("../../connectors/chains/baseSepolia.js"),require("../../connectors/chains/berachainArtio.js"),require("../../connectors/chains/celo.js"),require("../../connectors/chains/celoAlfajores.js"),require("../../connectors/chains/filecoin.js"),require("../../connectors/chains/filecoinCalibration.js"),require("../../connectors/chains/garnetHolesky.js"),require("../../connectors/chains/holesky.js"),require("../../connectors/chains/linea.js"),require("../../connectors/chains/lineaTestnet.js"),require("../../connectors/chains/lukso.js"),require("../../connectors/chains/mainnet.js"),require("../../connectors/chains/optimism.js"),require("../../connectors/chains/optimismSepolia.js"),require("../../connectors/chains/polygon.js"),require("../../connectors/chains/polygonAmoy.js"),require("../../connectors/chains/redstone.js"),require("../../connectors/chains/sepolia.js"),require("../../connectors/chains/zora.js"),require("../../connectors/chains/zoraSepolia.js"),require("../../connectors/chains/zoraTestnet.js"),require("../../connectors/chains/utils.js"),require("../../lib/solana/index.js"),require("../../theme.js"),require("tinycolor2"),require("../../lib/cybr53.js"),require("qrcode"),require("../../svg/black-rounded-square.js"),require("../../connectors/get-legacy-injected-providers.js"),require("../../connectors/is-wallet-installed.js"),require("../../errors.js"),require("ofetch"),require("../../utils/eth/getPublicClient.js"),require("viem"),require("../../components/ModalHeader.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("../../hooks/index.js"),require("@heroicons/react/24/outline/InformationCircleIcon"),require("../../components/ui/chips/Chip.js"),require("../../components/ui/animation/LoadingSkeleton.js"),require("../../components/ui/layout/Column.js"),require("../../components/ui/typography/ErrorMessage.js"),require("../../components/ui/typography/LabelXs.js"),require("../../components/ui/wallet/Address.js"),require("@heroicons/react/24/outline/CheckIcon"),require("@heroicons/react/24/outline/Square2StackIcon"),require("../../components/ui/wallet/shared.js"),require("../../components/PrefetchedImage.js"),require("../../utils/buffer/readBigInt64LE.js");let A=({...r})=>/*#__PURE__*/e.jsx(b.Blobby,{color:"black",...r}),x={devnet:"Devnet","mainnet-beta":"Solana",testnet:"Testnet"};exports.ManualTransferScreen=()=>{let{wallets:b}=p.useWallets(),{wallets:E}=T.useSolanaWallets(),{data:k,setModalData:M,navigate:w,lastScreen:N}=j.usePrivyModal(),{rpcConfig:L,appId:B,createAnalyticsEvent:P,closePrivyModal:_}=h.usePrivyInternal(),W=q.useAppConfig(),[F,O]=r.useState(void 0),[R,D]=r.useState(!1),U=v.usePlugins(),z=k?.funding,{reloadBalance:H}=m.useWalletBalance({rpcConfig:L,appId:B,address:"ethereum"===z.chainType?z.address:void 0,chain:"ethereum"===z.chainType?z.chain:void 0}),$="solana"===z.chainType,G=$?"SOL":z.erc20Address?z.erc20ContractInfo?.symbol:z.chain.nativeCurrency.symbol,Q=$?E.find((({address:e})=>e===z.address)):b.find((({address:e})=>I.formatWalletAddress(e)===I.formatWalletAddress(z.address)));if(!z)return M({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:N||S.ModalScreen.FUNDING_METHOD_SELECTION_SCREEN},funding:k?.funding,sendTransaction:k?.sendTransaction}),w(S.ModalScreen.ERROR_SCREEN),/*#__PURE__*/e.jsx(e.Fragment,{});r.useEffect((()=>{let e=$?async function(){if("solana"!==z.chainType)return;let e=U(C.SOLANA_FUNDING_PLUGIN_ID);e?e.getBalance({address:z.address,cluster:z.cluster}).then((e=>{let r=BigInt(e);F&&r>F&&(D(!0),P({eventName:g.ON_RAMP_COMPLETE_ANALYTICS_EVENT,payload:{provider:"manual",status:"success",chainType:"solana",address:Q?.address,value:(r-F).toString()}})),O(r)})):console.warn("Unable to load solana plugin, skipping balance")}:async function(){"ethereum"===z.chainType&&(async()=>{if(!z.erc20Address)return await H()??BigInt(0);{let{balance:e}=await f.getErc20Balance({chain:z.chain,address:z.address,erc20Address:z.erc20Address,rpcConfig:L,appId:B});return e}})().then((e=>{F&&e>F&&(D(!0),P({eventName:g.ON_RAMP_COMPLETE_ANALYTICS_EVENT,payload:{provider:"manual",status:"success",chainType:"ethereum",address:Q?.address,value:(e-F).toString()}})),O(e)})).catch((()=>O(void 0)))},r=setInterval(e,2e3);return e(),()=>clearInterval(r)}),[F]);let Y=r.useMemo((()=>void 0!==F&&F>=parseFloat(z.amount)),[F,z.amount]),V=r.useMemo((()=>null==F?"":z.isUSDC?n.formatTokenAmount({amount:F,decimals:6}):$?y.getNativeCurrencyFromLamports(F,3,!0,!0):null!=z.erc20ContractInfo?.decimals?n.formatTokenAmount({amount:F,decimals:z.erc20ContractInfo.decimals}):n.formatWeiAmount({wei:F})),[F,$,z]),X="ethereum"===z.chainType?z.chain.name:x[z.cluster.name];/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(t.default,{}),/*#__PURE__*/e.jsxs(l.Title,{children:["Receive ",z.amount," ",G]}),/*#__PURE__*/e.jsxs(u.Subtitle,{children:["Scan this code or copy your wallet address to receive funds on ",X,"."]}),/*#__PURE__*/e.jsxs(o.FlexContainer,{style:{gap:"1rem",margin:"1rem 0"},children:[/*#__PURE__*/e.jsx(a.QrCode,{url:`${z.chainType}:${z.address}`,size:200,squareLogoElement:A}),/*#__PURE__*/e.jsxs(c.InfoBanner,{theme:W.appearance.palette.colorScheme,children:["Make sure to send funds on ",X,"."]}),/*#__PURE__*/e.jsx(d.WalletInfoCard,{title:"Your wallet",errMsg:void 0,showIcon:!0,isLoading:!z||void 0===F,isPulsing:!Y,balance:`${V} ${G}`,address:z.address,statusColor:Y?"green":"gray"}),R&&/*#__PURE__*/e.jsx(s.PrimaryButton,{onClick:()=>_({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),/*#__PURE__*/e.jsx(i.BlobbyFooter,{})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon"),n=require("@heroicons/react/24/outline/CheckCircleIcon"),o=require("@heroicons/react/24/outline/ClockIcon"),i=require("@heroicons/react/24/outline/ShieldCheckIcon"),s=require("react"),t=require("styled-components"),c=require("../../components/Button.js"),a=require("../../components/Loader.js"),l=require("../../components/ModalFooter.js"),u=require("../../components/ModalHeader.js"),d=require("../../hooks/internal-context.js"),h=require("../../hooks/modal-context.js"),j=require("../../hooks/privy-context.js"),m=require("../../hooks/useMfaEnrollment.js"),y=require("../../svg/face-id.js"),q=require("../../svg/fingerprint.js"),p=require("../ErrorScreen.js"),g=require("../LinkPasskeyScreen.js"),x=require("./StyledComponents.js");function k(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../configuration/context.js"),require("../../config.js"),require("../../configuration/defaultClientConfig.js"),require("../../constants.js"),require("../../configuration/login-methods.js"),require("../../configuration/wallets.js"),require("../../connectors/chains/index.js"),require("../../connectors/chains/arbitrum.js"),require("../../connectors/chains/arbitrumSepolia.js"),require("../../connectors/chains/avalanche.js"),require("../../connectors/chains/avalancheFuji.js"),require("../../connectors/chains/base.js"),require("../../connectors/chains/baseSepolia.js"),require("../../connectors/chains/berachainArtio.js"),require("../../connectors/chains/celo.js"),require("../../connectors/chains/celoAlfajores.js"),require("../../connectors/chains/filecoin.js"),require("../../connectors/chains/filecoinCalibration.js"),require("../../connectors/chains/garnetHolesky.js"),require("../../connectors/chains/holesky.js"),require("../../connectors/chains/linea.js"),require("../../connectors/chains/lineaTestnet.js"),require("../../connectors/chains/lukso.js"),require("../../connectors/chains/mainnet.js"),require("../../connectors/chains/optimism.js"),require("../../connectors/chains/optimismSepolia.js"),require("../../connectors/chains/polygon.js"),require("../../connectors/chains/polygonAmoy.js"),require("../../connectors/chains/redstone.js"),require("../../connectors/chains/sepolia.js"),require("../../connectors/chains/zora.js"),require("../../connectors/chains/zoraSepolia.js"),require("../../connectors/chains/zoraTestnet.js"),require("../../connectors/chains/utils.js"),require("../../lib/solana/index.js"),require("../../theme.js"),require("tinycolor2"),require("../../lib/cybr53.js"),require("../../svg/protected-by-privy.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("../../hooks/index.js"),require("../../components/PrefetchedImage.js"),require("../index.js"),require("@heroicons/react/24/outline/ExclamationTriangleIcon"),require("@heroicons/react/24/outline/PhoneIcon"),require("../../components/CircleBorder.js"),require("../../components/layout/StackedContainer.js"),require("../../embedded-wallets/errors.js"),require("../../embedded-wallets/types.js"),require("../../errors.js"),require("ofetch"),require("../../hooks/captcha-context.js"),require("../../utils/index.js"),require("../../connectors/get-legacy-injected-providers.js"),require("../../connectors/is-wallet-installed.js"),require("../../utils/eth/getPublicClient.js"),require("viem"),require("../../svg/lock-closed.js"),require("@heroicons/react/24/outline/TrashIcon"),require("@heroicons/react/24/solid/CheckBadgeIcon"),require("@heroicons/react/24/solid/LockClosedIcon");var f=/*#__PURE__*/k(r),C=/*#__PURE__*/k(n),I=/*#__PURE__*/k(o),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon"),n=require("@heroicons/react/24/outline/CheckCircleIcon"),o=require("@heroicons/react/24/outline/ClockIcon"),i=require("@heroicons/react/24/outline/ShieldCheckIcon"),s=require("react"),t=require("styled-components"),c=require("../../components/Button.js"),a=require("../../components/Loader.js"),l=require("../../components/ModalFooter.js"),u=require("../../components/ModalHeader.js"),d=require("../../hooks/internal-context.js"),h=require("../../hooks/modal-context.js"),j=require("../../hooks/privy-context.js"),m=require("../../hooks/useMfaEnrollment.js"),y=require("../../svg/face-id.js"),q=require("../../svg/fingerprint.js"),p=require("../ErrorScreen.js"),g=require("../LinkPasskeyScreen.js"),x=require("./StyledComponents.js");function k(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../configuration/context.js"),require("../../config.js"),require("../../configuration/defaultClientConfig.js"),require("../../constants.js"),require("../../configuration/login-methods.js"),require("../../configuration/wallets.js"),require("../../connectors/chains/index.js"),require("../../connectors/chains/arbitrum.js"),require("../../connectors/chains/arbitrumSepolia.js"),require("../../connectors/chains/avalanche.js"),require("../../connectors/chains/avalancheFuji.js"),require("../../connectors/chains/base.js"),require("../../connectors/chains/baseSepolia.js"),require("../../connectors/chains/berachainArtio.js"),require("../../connectors/chains/celo.js"),require("../../connectors/chains/celoAlfajores.js"),require("../../connectors/chains/filecoin.js"),require("../../connectors/chains/filecoinCalibration.js"),require("../../connectors/chains/garnetHolesky.js"),require("../../connectors/chains/holesky.js"),require("../../connectors/chains/linea.js"),require("../../connectors/chains/lineaTestnet.js"),require("../../connectors/chains/lukso.js"),require("../../connectors/chains/mainnet.js"),require("../../connectors/chains/optimism.js"),require("../../connectors/chains/optimismSepolia.js"),require("../../connectors/chains/polygon.js"),require("../../connectors/chains/polygonAmoy.js"),require("../../connectors/chains/redstone.js"),require("../../connectors/chains/sepolia.js"),require("../../connectors/chains/zora.js"),require("../../connectors/chains/zoraSepolia.js"),require("../../connectors/chains/zoraTestnet.js"),require("../../connectors/chains/utils.js"),require("../../lib/solana/index.js"),require("../../theme.js"),require("tinycolor2"),require("../../lib/cybr53.js"),require("../../svg/protected-by-privy.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("../../hooks/index.js"),require("../../components/PrefetchedImage.js"),require("../index.js"),require("@heroicons/react/24/outline/ExclamationTriangleIcon"),require("@heroicons/react/24/outline/PhoneIcon"),require("../../components/CircleBorder.js"),require("../../components/layout/StackedContainer.js"),require("../../embedded-wallets/errors.js"),require("../../embedded-wallets/types.js"),require("../../errors.js"),require("ofetch"),require("../../hooks/captcha-context.js"),require("../../utils/index.js"),require("../../connectors/get-legacy-injected-providers.js"),require("../../connectors/is-wallet-installed.js"),require("../../utils/eth/getPublicClient.js"),require("viem"),require("../../svg/lock-closed.js"),require("@heroicons/react/24/outline/TrashIcon"),require("@heroicons/react/24/solid/CheckBadgeIcon"),require("@heroicons/react/24/solid/LockClosedIcon");var f=/*#__PURE__*/k(r),C=/*#__PURE__*/k(n),I=/*#__PURE__*/k(o),b=/*#__PURE__*/k(i);let w=({onReset:r,onClose:n,onClick:o,isCreating:i})=>/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(u.ModalHeader,{backFn:r,onClose:n},"header"),/*#__PURE__*/e.jsx(x.AppLogoContainer,{children:/*#__PURE__*/e.jsxs(g.DoubleIconWrapper,{children:[/*#__PURE__*/e.jsx(y.FaceId,{}),/*#__PURE__*/e.jsx(q.FingerPrint,{})]})}),/*#__PURE__*/e.jsx(x.Title,{children:"Set up passkey verification"}),/*#__PURE__*/e.jsxs(x.List,{children:[/*#__PURE__*/e.jsxs(x.ListItem,{children:[/*#__PURE__*/e.jsx(x.ListItemIcon,{children:/*#__PURE__*/e.jsx(b.default,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),/*#__PURE__*/e.jsxs(x.ListItem,{children:[/*#__PURE__*/e.jsx(x.ListItemIcon,{children:/*#__PURE__*/e.jsx(I.default,{})}),"Takes seconds to set up and use"]}),/*#__PURE__*/e.jsxs(x.ListItem,{children:[/*#__PURE__*/e.jsx(x.ListItemIcon,{children:/*#__PURE__*/e.jsx(f.default,{})}),"Use your passkey to verify transactions and login to your account"]})]}),/*#__PURE__*/e.jsx(c.PrimaryButton,{style:{marginTop:"2.25rem"},onClick:o,loading:i,children:"Add a new passkey"}),/*#__PURE__*/e.jsx(l.ModalFooter,{})]}),v=({onReset:r,onClose:n,onAddPasskey:o,onSubmitEnrollment:i,passkeys:t,isSubmitting:d,isCreating:h})=>{let[j,m]=s.useState(!1),p=j?t.length:t.length>3?2:3;/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(u.ModalHeader,{backFn:j?()=>m(!1):r,onClose:n},"header"),!j&&/*#__PURE__*/e.jsx(x.AppLogoContainer,{children:/*#__PURE__*/e.jsxs(g.DoubleIconWrapper,{children:[/*#__PURE__*/e.jsx(y.FaceId,{}),/*#__PURE__*/e.jsx(q.FingerPrint,{})]})}),/*#__PURE__*/e.jsx(x.Title,{children:"Enable your passkeys for verification"}),/*#__PURE__*/e.jsxs(x.List,{children:[t.slice(0,p).map((r=>/*#__PURE__*/e.jsxs(P,{children:[/*#__PURE__*/e.jsx(L,{children:A(r)}),/*#__PURE__*/e.jsxs(F,{children:["Last used: ",r.latestVerifiedAt?.toLocaleString()]})]},r.credentialId))),!j&&t.length>3&&/*#__PURE__*/e.jsx(E,{onClick:()=>m(!0),children:"View All"})]}),/*#__PURE__*/e.jsx(c.PrimaryButton,{style:{marginTop:"1.5rem"},onClick:i,loading:d,children:"Enable passkeys"}),t.length<5&&/*#__PURE__*/e.jsx(E,{style:{marginTop:"0.5rem"},onClick:o,disabled:h,children:h?/*#__PURE__*/e.jsx(a.Loader,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),/*#__PURE__*/e.jsx(l.ModalFooter,{})]})},S=({onClick:r,onClose:n})=>/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(u.ModalHeader,{onClose:n},"header"),/*#__PURE__*/e.jsx(x.IconWrapper,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e.jsx(C.default,{})}),/*#__PURE__*/e.jsx(x.Title,{children:"Passkey verification added"}),/*#__PURE__*/e.jsx(x.SubTitle,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),/*#__PURE__*/e.jsx(x.BottomSection,{children:/*#__PURE__*/e.jsx(c.PrimaryButton,{onClick:r,children:"Done"})}),/*#__PURE__*/e.jsx(l.ModalFooter,{})]}),P=/*#__PURE__*/t.styled.div.withConfig({displayName:"PasskeyItem",componentId:"sc-f71dd8ba-0"})(["&&{padding:0.75rem 1rem;text-align:left;border-radius:0.5rem;border:1px solid var(--privy-color-foreground-4);width:100%;}"]),L=/*#__PURE__*/t.styled.div.withConfig({displayName:"PasskeyItemTitle",componentId:"sc-f71dd8ba-1"})(["font-size:0.875rem;line-height:1.375rem;font-weight:500;color:var(--privy-color-foreground-1);"]),F=/*#__PURE__*/t.styled.div.withConfig({displayName:"PasskeyItemSubtitle",componentId:"sc-f71dd8ba-2"})(["font-size:0.75rem;font-weight:400;line-height:1.125rem;color:var(--privy-color-foreground-2);"]),A=e=>e.authenticatorName?e.createdWithBrowser?`${e.authenticatorName} on ${e.createdWithBrowser}`:e.authenticatorName:e.createdWithBrowser?e.createdWithOs?`${e.createdWithBrowser} on ${e.createdWithOs}`:`${e.createdWithBrowser}`:"Unknown device";const E=/*#__PURE__*/t.styled.button.withConfig({displayName:"StyledLink",componentId:"sc-f71dd8ba-3"})(["&&{width:100%;font-size:0.875rem;line-height:1rem;@media (min-width:440px){font-size:14px;}display:flex;gap:12px;justify-content:center;padding:0.75rem 1rem;background-color:var(--privy-color-background);transition:background-color 200ms ease;color:var(--privy-color-accent);:focus{outline:none;box-shadow:none;}}"]);exports.EnrollPasskey=({onComplete:r,onClose:n,onReset:o})=>{let{user:i}=j.usePrivyContext(),{data:t}=h.usePrivyModal(),{initLinkWithPasskey:c,linkWithPasskey:a}=d.usePrivyInternal(),{initEnrollmentWithPasskey:l,submitEnrollmentWithPasskey:u}=m.useMfaEnrollment(),[y,q]=s.useState(!1),[g,x]=s.useState(!1),[k,f]=s.useState(!1),[C,I]=s.useState(null),b=s.useMemo((()=>i?.linkedAccounts.filter((e=>"passkey"===e.type))??[]),[i]),P=()=>{t?.mfaEnrollmentFlow?.onSuccess(),r()},L=async e=>{q(!0);try{await l(),await u({credentialIds:e},{removeForLogin:t?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa}),f(!0)}catch(e){I(e)}finally{q(!1)}},F=async()=>{x(!0),I(null);try{await c();let e=await a(),r=e?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];await L(r)}catch(e){I(e)}finally{x(!1)}};return 0===b.length||g?/*#__PURE__*/e.jsx(w,{onReset:o,onClose:n,onClick:F,isCreating:g}):k?/*#__PURE__*/e.jsx(S,{onClick:P,onClose:P}):C?/*#__PURE__*/e.jsx(p.ErrorScreenView,{error:C,backFn:()=>I(null),onClick:()=>I(null)}):/*#__PURE__*/e.jsx(v,{passkeys:b,isSubmitting:y,isCreating:g,onReset:o,onClose:n,onSubmitEnrollment:()=>L(b.map((e=>e.credentialId))),onAddPasskey:F})},exports.StyledLink=E;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),o=require("@heroicons/react/24/outline/ShieldCheckIcon"),n=require("@heroicons/react/24/solid/CheckBadgeIcon"),s=require("@heroicons/react/24/solid/IdentificationIcon"),i=require("react"),t=require("../../components/Button.js"),c=require("../../components/Loader.js"),a=require("../../components/ModalFooter.js"),l=require("../../components/ModalHeader.js"),u=require("../../hooks/internal-context.js"),d=require("../../hooks/modal-context.js"),h=require("../../hooks/privy-context.js"),j=require("../../hooks/useMfa.js"),m=require("../../hooks/useMfaEnrollment.js"),q=require("../../svg/mfa-shield.js"),p=require("./EnrollLandingScreen.js"),y=require("./EnrollPasskey.js"),x=require("./EnrollSms.js"),f=require("./EnrollTotp.js"),g=require("./StyledComponents.js");function k(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("styled-components"),require("../../configuration/context.js"),require("../../config.js"),require("../../configuration/defaultClientConfig.js"),require("../../constants.js"),require("../../configuration/login-methods.js"),require("../../configuration/wallets.js"),require("../../connectors/chains/index.js"),require("../../connectors/chains/arbitrum.js"),require("../../connectors/chains/arbitrumSepolia.js"),require("../../connectors/chains/avalanche.js"),require("../../connectors/chains/avalancheFuji.js"),require("../../connectors/chains/base.js"),require("../../connectors/chains/baseSepolia.js"),require("../../connectors/chains/berachainArtio.js"),require("../../connectors/chains/celo.js"),require("../../connectors/chains/celoAlfajores.js"),require("../../connectors/chains/filecoin.js"),require("../../connectors/chains/filecoinCalibration.js"),require("../../connectors/chains/garnetHolesky.js"),require("../../connectors/chains/holesky.js"),require("../../connectors/chains/linea.js"),require("../../connectors/chains/lineaTestnet.js"),require("../../connectors/chains/lukso.js"),require("../../connectors/chains/mainnet.js"),require("../../connectors/chains/optimism.js"),require("../../connectors/chains/optimismSepolia.js"),require("../../connectors/chains/polygon.js"),require("../../connectors/chains/polygonAmoy.js"),require("../../connectors/chains/redstone.js"),require("../../connectors/chains/sepolia.js"),require("../../connectors/chains/zora.js"),require("../../connectors/chains/zoraSepolia.js"),require("../../connectors/chains/zoraTestnet.js"),require("../../connectors/chains/utils.js"),require("../../lib/solana/index.js"),require("../../theme.js"),require("tinycolor2"),require("../../lib/cybr53.js"),require("../../svg/protected-by-privy.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("../../hooks/index.js"),require("../../components/PrefetchedImage.js"),require("../index.js"),require("@heroicons/react/24/outline/ChevronRightIcon"),require("@heroicons/react/24/outline/DevicePhoneMobileIcon"),require("@heroicons/react/24/outline/FingerPrintIcon"),require("@heroicons/react/24/outline/MinusCircleIcon"),require("@heroicons/react/24/outline/PhoneIcon"),require("../../components/ui/chips/Chip.js"),require("../../components/ui/animation/LoadingSkeleton.js"),require("../LandingScreen/styles.js"),require("@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon"),require("@heroicons/react/24/outline/CheckCircleIcon"),require("@heroicons/react/24/outline/ClockIcon"),require("../../svg/face-id.js"),require("../../svg/fingerprint.js"),require("../ErrorScreen.js"),require("@heroicons/react/24/outline/ExclamationTriangleIcon"),require("../../components/CircleBorder.js"),require("../../components/layout/StackedContainer.js"),require("../../embedded-wallets/errors.js"),require("../../embedded-wallets/types.js"),require("../../errors.js"),require("ofetch"),require("../../hooks/captcha-context.js"),require("../../utils/index.js"),require("../../connectors/get-legacy-injected-providers.js"),require("../../connectors/is-wallet-installed.js"),require("../../utils/eth/getPublicClient.js"),require("viem"),require("../../svg/lock-closed.js"),require("../LinkPasskeyScreen.js"),require("@heroicons/react/24/outline/TrashIcon"),require("@heroicons/react/24/solid/LockClosedIcon"),require("@privy-io/js-sdk-core"),require("../../components/ConnectPhoneForm.js"),require("../../recent-login/context.js"),require("../../hooks/events-context.js"),require("../../storage.js"),require("../../components/PhoneCountryDropdown.js"),require("../../components/PinInput.js"),require("react-device-detect"),require("../../components/CopyToClipboard.js"),require("../../svg/checkmark.js"),require("../../svg/copy.js"),require("../../components/Layouts.js"),require("../../svg/qr-codes.js"),require("@heroicons/react/24/solid/ShieldCheckIcon"),require("../../components/QrCode.js"),require("qrcode"),require("../../svg/black-rounded-square.js"),require("../../svg/coinbase-wallet.js");var M=/*#__PURE__*/k(r),C=/*#__PURE__*/k(o),v=/*#__PURE__*/k(n),S=/*#__PURE__*/k(s);exports.MfaEnrollmentFlowScreen=()=>{let{user:r,enrollInMfa:o}=h.usePrivyContext(),[n,s]=i.useState(null),{unenrollWithSms:k,unenrollWithTotp:I,unenrollWithPasskey:b}=m.useMfaEnrollment(),{app:w,ready:F,data:P,onUserCloseViaDialogOrKeybindRef:T}=d.usePrivyModal(),{closePrivyModal:E}=u.usePrivyInternal(),{promptMfa:A}=j.useMfa(),{initEnrollmentWithTotp:B}=m.useMfaEnrollment(),[L,R]=i.useState(!1),[W,H]=i.useState(null),[z,D]=i.useState(null),O=()=>{E({shouldCallAuthOnSuccess:!0}),o(!1),setTimeout((()=>{s(null),H(null)}),500)},{initEnrollmentWithPasskey:Q,submitEnrollmentWithPasskey:Y}=m.useMfaEnrollment(),[K,N]=i.useState(!1),[U,V]=i.useState(null);T.current=O;let X=r?.mfaMethods.includes("sms"),G=!!r?.phone,J=r?.mfaMethods.includes("totp"),Z=r?.mfaMethods.includes("passkey"),$=X||J||Z,_=r?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function ee(){s(null),H(null)}if(i.useEffect((()=>{$&&R(!0)}),[$]),!F||!r||!w/*#__PURE__*/)return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:O},"header"),/*#__PURE__*/e.jsx(g.AppLogoContainer,{children:/*#__PURE__*/e.jsx(q.MfaShieldIcon,{})}),/*#__PURE__*/e.jsx(g.Container,{children:/*#__PURE__*/e.jsx(c.Loader,{})}),/*#__PURE__*/e.jsx(a.ModalFooter,{})]});if("sms"===n)/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{backFn:ee,onClose:O},"header"),/*#__PURE__*/e.jsx(g.IconWrapper,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e.jsx(M.default,{})}),/*#__PURE__*/e.jsx(g.Title,{children:"Remove SMS verification?"}),/*#__PURE__*/e.jsxs(g.SubTitle,{children:["MFA adds an extra layer of security to your ",w?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e.jsx(g.BottomSection,{children:/*#__PURE__*/e.jsx(t.PrimaryButton,{warn:!0,onClick:async function(){s(null);try{await k()}catch(e){s(null)}},children:"Remove SMS for MFA"})}),/*#__PURE__*/e.jsx(a.ModalFooter,{})]});if("totp"===n)/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{backFn:ee,onClose:O},"header"),/*#__PURE__*/e.jsx(g.IconWrapper,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e.jsx(M.default,{})}),/*#__PURE__*/e.jsx(g.Title,{children:"Remove Authenticator App verification?"}),/*#__PURE__*/e.jsxs(g.SubTitle,{children:["MFA adds an extra layer of security to your ",w?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e.jsx(g.BottomSection,{children:/*#__PURE__*/e.jsx(t.PrimaryButton,{warn:!0,onClick:async function(){s(null);try{await I()}catch(e){s(null)}},children:"Remove Authenticator App for MFA"})}),/*#__PURE__*/e.jsx(a.ModalFooter,{})]});if("passkey"===n)/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{backFn:ee,onClose:O},"header"),/*#__PURE__*/e.jsx(g.IconWrapper,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e.jsx(M.default,{})}),/*#__PURE__*/e.jsx(g.Title,{children:"Are you sure you want to remove passkey verification?"}),/*#__PURE__*/e.jsx(g.SubTitle,{children:"Removing your passkey will remove as both a verification method and a login method."}),/*#__PURE__*/e.jsx(g.BottomSection,{children:/*#__PURE__*/e.jsx(t.PrimaryButton,{warn:!0,onClick:async function(){s(null);try{await b()}catch(e){s(null)}},children:"Yes, remove"})}),/*#__PURE__*/e.jsx(a.ModalFooter,{})]});if(0===P.mfaEnrollmentFlow.mfaMethods.length&&!$)/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:O},"header"),/*#__PURE__*/e.jsx(g.IconWrapper,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e.jsx(C.default,{})}),/*#__PURE__*/e.jsx(g.Title,{children:"Add more security"}),/*#__PURE__*/e.jsxs(g.SubTitle,{children:[w?.name," does not have any verification methods enabled."]}),/*#__PURE__*/e.jsx(g.BottomSection,{children:/*#__PURE__*/e.jsx(t.PrimaryButton,{onClick:O,children:"Close"})}),/*#__PURE__*/e.jsx(a.ModalFooter,{})]});let re=!$&&!L;return re?/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:O},"header"),/*#__PURE__*/e.jsx(g.IconWrapper,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e.jsx(C.default,{})}),/*#__PURE__*/e.jsx(g.Title,{children:"Transaction Protection"}),/*#__PURE__*/e.jsx(g.SubTitle,{children:"Set up transaction protection to add an extra layer of security to your account"}),/*#__PURE__*/e.jsxs(g.List,{children:[/*#__PURE__*/e.jsxs(g.ListItem,{children:[/*#__PURE__*/e.jsx(g.ListItemIcon,{children:/*#__PURE__*/e.jsx(v.default,{})}),"Enable 2-Step verification for your ",w?.name," wallet."]}),/*#__PURE__*/e.jsxs(g.ListItem,{children:[/*#__PURE__*/e.jsx(g.ListItemIcon,{children:/*#__PURE__*/e.jsx(S.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),/*#__PURE__*/e.jsxs(g.BottomSection,{children:[/*#__PURE__*/e.jsx(t.PrimaryButton,{onClick:()=>R(!0),children:"Continue"}),/*#__PURE__*/e.jsx(t.SecondaryButton,{onClick:O,children:"Not now"})]}),/*#__PURE__*/e.jsx(a.ModalFooter,{})]}):"sms"===W?/*#__PURE__*/e.jsx(x.EnrollSms,{onComplete:O,onReset:ee,onClose:O}):"totp"===W&&z?/*#__PURE__*/e.jsx(f.EnrollTotp,{onComplete:O,onClose:O,onReset:ee,totpInfo:z}):"passkey"===W?/*#__PURE__*/e.jsx(y.EnrollPasskey,{onComplete:O,onReset:ee,onClose:O}):/*#__PURE__*/e.jsx(p.EnrollLandingScreen,{showIntro:re,userMfaMethods:r.mfaMethods,appMfaMethods:w.mfa.methods,userHasAuthSms:G,onBackToIntro:function(){R(!1)},handleSelectMethod:async function(e){return await A().catch(V),"totp"===e?(H(e),D(null),void B().then((e=>{D(e)})).catch((()=>{D(null),ee()}))):"passkey"===e&&1===_.length?await async function(){N(!0);try{await Q(),await Y({credentialIds:_})}catch(e){V(e)}finally{N(!1)}}():void H(e)},isTotpLoading:"totp"===W&&!z,isPasskeyLoading:K,error:U,onClose:O,setRemovingMfaMethod:async e=>{await A().catch(V),s(e)}})};
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),o=require("@heroicons/react/24/outline/ShieldCheckIcon"),n=require("@heroicons/react/24/solid/CheckBadgeIcon"),s=require("@heroicons/react/24/solid/IdentificationIcon"),i=require("react"),t=require("../../components/Button.js"),c=require("../../components/Loader.js"),a=require("../../components/ModalFooter.js"),l=require("../../components/ModalHeader.js"),u=require("../../hooks/internal-context.js"),h=require("../../hooks/modal-context.js"),d=require("../../hooks/privy-context.js"),j=require("../../hooks/useMfa.js"),m=require("../../hooks/useMfaEnrollment.js"),q=require("../../svg/mfa-shield.js"),p=require("./EnrollLandingScreen.js"),y=require("./EnrollPasskey.js"),f=require("./EnrollSms.js"),x=require("./EnrollTotp.js"),g=require("./StyledComponents.js");function k(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("styled-components"),require("../../configuration/context.js"),require("../../config.js"),require("../../configuration/defaultClientConfig.js"),require("../../constants.js"),require("../../configuration/login-methods.js"),require("../../configuration/wallets.js"),require("../../connectors/chains/index.js"),require("../../connectors/chains/arbitrum.js"),require("../../connectors/chains/arbitrumSepolia.js"),require("../../connectors/chains/avalanche.js"),require("../../connectors/chains/avalancheFuji.js"),require("../../connectors/chains/base.js"),require("../../connectors/chains/baseSepolia.js"),require("../../connectors/chains/berachainArtio.js"),require("../../connectors/chains/celo.js"),require("../../connectors/chains/celoAlfajores.js"),require("../../connectors/chains/filecoin.js"),require("../../connectors/chains/filecoinCalibration.js"),require("../../connectors/chains/garnetHolesky.js"),require("../../connectors/chains/holesky.js"),require("../../connectors/chains/linea.js"),require("../../connectors/chains/lineaTestnet.js"),require("../../connectors/chains/lukso.js"),require("../../connectors/chains/mainnet.js"),require("../../connectors/chains/optimism.js"),require("../../connectors/chains/optimismSepolia.js"),require("../../connectors/chains/polygon.js"),require("../../connectors/chains/polygonAmoy.js"),require("../../connectors/chains/redstone.js"),require("../../connectors/chains/sepolia.js"),require("../../connectors/chains/zora.js"),require("../../connectors/chains/zoraSepolia.js"),require("../../connectors/chains/zoraTestnet.js"),require("../../connectors/chains/utils.js"),require("../../lib/solana/index.js"),require("../../theme.js"),require("tinycolor2"),require("../../lib/cybr53.js"),require("../../svg/protected-by-privy.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("../../hooks/index.js"),require("../../components/PrefetchedImage.js"),require("../index.js"),require("@heroicons/react/24/outline/ChevronRightIcon"),require("@heroicons/react/24/outline/DevicePhoneMobileIcon"),require("@heroicons/react/24/outline/FingerPrintIcon"),require("@heroicons/react/24/outline/MinusCircleIcon"),require("@heroicons/react/24/outline/PhoneIcon"),require("../../components/ui/chips/Chip.js"),require("../../components/ui/animation/LoadingSkeleton.js"),require("../LandingScreen/styles.js"),require("@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon"),require("@heroicons/react/24/outline/CheckCircleIcon"),require("@heroicons/react/24/outline/ClockIcon"),require("../../svg/face-id.js"),require("../../svg/fingerprint.js"),require("../ErrorScreen.js"),require("@heroicons/react/24/outline/ExclamationTriangleIcon"),require("../../components/CircleBorder.js"),require("../../components/layout/StackedContainer.js"),require("../../embedded-wallets/errors.js"),require("../../embedded-wallets/types.js"),require("../../errors.js"),require("ofetch"),require("../../hooks/captcha-context.js"),require("../../utils/index.js"),require("../../connectors/get-legacy-injected-providers.js"),require("../../connectors/is-wallet-installed.js"),require("../../utils/eth/getPublicClient.js"),require("viem"),require("../../svg/lock-closed.js"),require("../LinkPasskeyScreen.js"),require("@heroicons/react/24/outline/TrashIcon"),require("@heroicons/react/24/solid/LockClosedIcon"),require("@privy-io/js-sdk-core"),require("../../components/ConnectPhoneForm.js"),require("../../recent-login/context.js"),require("../../hooks/events-context.js"),require("../../storage.js"),require("../../components/PhoneCountryDropdown.js"),require("../../components/PinInput.js"),require("react-device-detect"),require("../../components/CopyToClipboard.js"),require("../../svg/checkmark.js"),require("../../svg/copy.js"),require("../../components/Layouts.js"),require("../../svg/qr-codes.js"),require("@heroicons/react/24/solid/ShieldCheckIcon"),require("../../components/QrCode.js"),require("qrcode"),require("../../svg/black-rounded-square.js"),require("../../svg/coinbase-wallet.js");var M=/*#__PURE__*/k(r),v=/*#__PURE__*/k(o),C=/*#__PURE__*/k(n),S=/*#__PURE__*/k(s);exports.MfaEnrollmentFlowScreen=()=>{let{user:r,enrollInMfa:o}=d.usePrivyContext(),[n,s]=i.useState(null),{unenrollWithSms:k,unenrollWithTotp:I,unenrollWithPasskey:b}=m.useMfaEnrollment(),{app:w,ready:F,data:E,onUserCloseViaDialogOrKeybindRef:P}=h.usePrivyModal(),{closePrivyModal:T}=u.usePrivyInternal(),{promptMfa:A}=j.useMfa(),{initEnrollmentWithTotp:B}=m.useMfaEnrollment(),[L,R]=i.useState(!1),[W,H]=i.useState(null),[U,O]=i.useState(null),z=()=>{T({shouldCallAuthOnSuccess:!0}),o(!1),setTimeout((()=>{s(null),H(null)}),500)},{initEnrollmentWithPasskey:D,submitEnrollmentWithPasskey:Q}=m.useMfaEnrollment(),[Y,K]=i.useState(!1),[N,V]=i.useState(null);P.current=z;let X=r?.mfaMethods.includes("sms"),G=!!r?.phone,J=r?.mfaMethods.includes("totp"),Z=r?.mfaMethods.includes("passkey"),$=X||J||Z,_=r?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function ee(){s(null),H(null)}if(i.useEffect((()=>{$&&R(!0)}),[$]),!F||!r||!w/*#__PURE__*/)return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:z},"header"),/*#__PURE__*/e.jsx(g.AppLogoContainer,{children:/*#__PURE__*/e.jsx(q.MfaShieldIcon,{})}),/*#__PURE__*/e.jsx(g.Container,{children:/*#__PURE__*/e.jsx(c.Loader,{})}),/*#__PURE__*/e.jsx(a.ModalFooter,{})]});if("sms"===n)/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{backFn:ee,onClose:z},"header"),/*#__PURE__*/e.jsx(g.IconWrapper,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e.jsx(M.default,{})}),/*#__PURE__*/e.jsx(g.Title,{children:"Remove SMS verification?"}),/*#__PURE__*/e.jsxs(g.SubTitle,{children:["MFA adds an extra layer of security to your ",w?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e.jsx(g.BottomSection,{children:/*#__PURE__*/e.jsx(t.PrimaryButton,{warn:!0,onClick:async function(){s(null);try{await k()}catch(e){s(null)}},children:"Remove SMS for MFA"})}),/*#__PURE__*/e.jsx(a.ModalFooter,{})]});if("totp"===n)/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{backFn:ee,onClose:z},"header"),/*#__PURE__*/e.jsx(g.IconWrapper,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e.jsx(M.default,{})}),/*#__PURE__*/e.jsx(g.Title,{children:"Remove Authenticator App verification?"}),/*#__PURE__*/e.jsxs(g.SubTitle,{children:["MFA adds an extra layer of security to your ",w?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e.jsx(g.BottomSection,{children:/*#__PURE__*/e.jsx(t.PrimaryButton,{warn:!0,onClick:async function(){s(null);try{await I()}catch(e){s(null)}},children:"Remove Authenticator App for MFA"})}),/*#__PURE__*/e.jsx(a.ModalFooter,{})]});if("passkey"===n){let r=E?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{backFn:ee,onClose:z},"header"),/*#__PURE__*/e.jsx(g.IconWrapper,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e.jsx(M.default,{})}),/*#__PURE__*/e.jsx(g.Title,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/e.jsx(g.SubTitle,{children:r?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/e.jsx(g.BottomSection,{children:/*#__PURE__*/e.jsx(t.PrimaryButton,{warn:!0,onClick:async function(){s(null);try{await b({removeForLogin:E?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa})}catch(e){s(null)}},children:"Yes, remove"})}),/*#__PURE__*/e.jsx(a.ModalFooter,{})]})}if(0===E.mfaEnrollmentFlow.mfaMethods.length&&!$)/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:z},"header"),/*#__PURE__*/e.jsx(g.IconWrapper,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e.jsx(v.default,{})}),/*#__PURE__*/e.jsx(g.Title,{children:"Add more security"}),/*#__PURE__*/e.jsxs(g.SubTitle,{children:[w?.name," does not have any verification methods enabled."]}),/*#__PURE__*/e.jsx(g.BottomSection,{children:/*#__PURE__*/e.jsx(t.PrimaryButton,{onClick:z,children:"Close"})}),/*#__PURE__*/e.jsx(a.ModalFooter,{})]});let re=!$&&!L;return re?/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:z},"header"),/*#__PURE__*/e.jsx(g.IconWrapper,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e.jsx(v.default,{})}),/*#__PURE__*/e.jsx(g.Title,{children:"Transaction Protection"}),/*#__PURE__*/e.jsx(g.SubTitle,{children:"Set up transaction protection to add an extra layer of security to your account"}),/*#__PURE__*/e.jsxs(g.List,{children:[/*#__PURE__*/e.jsxs(g.ListItem,{children:[/*#__PURE__*/e.jsx(g.ListItemIcon,{children:/*#__PURE__*/e.jsx(C.default,{})}),"Enable 2-Step verification for your ",w?.name," wallet."]}),/*#__PURE__*/e.jsxs(g.ListItem,{children:[/*#__PURE__*/e.jsx(g.ListItemIcon,{children:/*#__PURE__*/e.jsx(S.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),/*#__PURE__*/e.jsxs(g.BottomSection,{children:[/*#__PURE__*/e.jsx(t.PrimaryButton,{onClick:()=>R(!0),children:"Continue"}),/*#__PURE__*/e.jsx(t.SecondaryButton,{onClick:z,children:"Not now"})]}),/*#__PURE__*/e.jsx(a.ModalFooter,{})]}):"sms"===W?/*#__PURE__*/e.jsx(f.EnrollSms,{onComplete:z,onReset:ee,onClose:z}):"totp"===W&&U?/*#__PURE__*/e.jsx(x.EnrollTotp,{onComplete:z,onClose:z,onReset:ee,totpInfo:U}):"passkey"===W?/*#__PURE__*/e.jsx(y.EnrollPasskey,{onComplete:z,onReset:ee,onClose:z}):/*#__PURE__*/e.jsx(p.EnrollLandingScreen,{showIntro:re,userMfaMethods:r.mfaMethods,appMfaMethods:w.mfa.methods,userHasAuthSms:G,onBackToIntro:function(){R(!1)},handleSelectMethod:async function(e){return await A().catch(V),"totp"===e?(H(e),O(null),void B().then((e=>{O(e)})).catch((()=>{O(null),ee()}))):"passkey"===e&&1===_.length?await async function(){K(!0);try{await D(),await Q({credentialIds:_},{removeForLogin:E?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa})}catch(e){V(e)}finally{K(!1)}}():void H(e)},isTotpLoading:"totp"===W&&!U,isPasskeyLoading:Y,error:N,onClose:z,setRemovingMfaMethod:async e=>{await A().catch(V),s(e)}})};
|
package/dist/dts/farcaster.d.mts
CHANGED
package/dist/dts/farcaster.d.ts
CHANGED
package/dist/dts/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { MouseEvent } from 'react';
|
|
3
|
-
import { C as Chain, d as UserRecoveryMethod, m as PrivyFarcasterSignerInitResponse, n as MfaSubmitArgs, E as EthereumRpcRequestType, o as SolanaRpcRequestType, p as EthereumRpcResponseType, q as SolanaRpcResponseType, r as PrivyClientConfig, s as RpcConfig, u as EIP1193Provider, v as EntropyIdVerifier$1, w as RequestArguments, x as WalletTimeoutError, y as WalletConnector, B as BaseConnectedEthereumWallet, z as WalletClientType, A as ConnectedWalletMetadata, D as ConnectorType, G as WalletListEntry, H as ExternalWalletsConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, g as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a1 as PrivyServerConfig, a as LoginMethod, a2 as SiweWalletMetadata, a3 as TelegramAuthResult, a4 as TelegramWebAppData, a5 as OAuthUserInfo, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, f as ConnectedSolanaWallet, ad as CustomAuthFlowState } from './types-
|
|
4
|
-
export { aw as Apple, aH as AppleOAuthWithMetadata, aP as ContractUIOptions, az as CrossAppAccount, aK as CrossAppAccountWithMetadata, at as Discord, aD as DiscordOAuthWithMetadata, aM as Email, ao as EmailWithMetadata, aT as Farcaster, aI as FarcasterWithMetadata, au as Github, aE as GithubOAuthWithMetadata, ar as Google, aB as GoogleOAuthWithMetadata, aA as LinkedAccountType, b as LinkedAccountWithMetadata, av as LinkedIn, aG as LinkedInOAuthWithMetadata, aV as LoginMethodOrderOption, af as MessageTypes, ah as MoonpayConfig, ai as MoonpayCurrencyCode, aR as MoonpayFundingConfig, aj as MoonpayPaymentMethod, aQ as NativeFundingConfig, an as NonEmptyArray, aU as Passkey, aL as PasskeyWithMetadata, aN as Phone, ap as PhoneWithMetadata, aS as PriceDisplayOptions, P as PrivyErrorCode, ak as Quantity, ag as SmartWallet, e as SolanaCluster, j as SolanaFundingConfig, S as SolanaTransactionReceipt, k as SupportedSolanaTransaction, ay as Telegram, aJ as TelegramWithMetadata, ax as Tiktok, aF as TiktokOAuthWithMetadata, al as TransactionLog, am as TransactionReceipt, aO as TransactionUIOptions, as as Twitter, aC as TwitterOAuthWithMetadata, ae as TypedMessage, aq as WalletWithMetadata } from './types-
|
|
3
|
+
import { C as Chain, d as UserRecoveryMethod, m as PrivyFarcasterSignerInitResponse, n as MfaSubmitArgs, E as EthereumRpcRequestType, o as SolanaRpcRequestType, p as EthereumRpcResponseType, q as SolanaRpcResponseType, r as PrivyClientConfig, s as RpcConfig, u as EIP1193Provider, v as EntropyIdVerifier$1, w as RequestArguments, x as WalletTimeoutError, y as WalletConnector, B as BaseConnectedEthereumWallet, z as WalletClientType, A as ConnectedWalletMetadata, D as ConnectorType, G as WalletListEntry, H as ExternalWalletsConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, g as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a1 as PrivyServerConfig, a as LoginMethod, a2 as SiweWalletMetadata, a3 as TelegramAuthResult, a4 as TelegramWebAppData, a5 as OAuthUserInfo, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, f as ConnectedSolanaWallet, ad as CustomAuthFlowState } from './types-B-zTuIEL.js';
|
|
4
|
+
export { aw as Apple, aH as AppleOAuthWithMetadata, aP as ContractUIOptions, az as CrossAppAccount, aK as CrossAppAccountWithMetadata, at as Discord, aD as DiscordOAuthWithMetadata, aM as Email, ao as EmailWithMetadata, aT as Farcaster, aI as FarcasterWithMetadata, au as Github, aE as GithubOAuthWithMetadata, ar as Google, aB as GoogleOAuthWithMetadata, aA as LinkedAccountType, b as LinkedAccountWithMetadata, av as LinkedIn, aG as LinkedInOAuthWithMetadata, aV as LoginMethodOrderOption, af as MessageTypes, ah as MoonpayConfig, ai as MoonpayCurrencyCode, aR as MoonpayFundingConfig, aj as MoonpayPaymentMethod, aQ as NativeFundingConfig, an as NonEmptyArray, aU as Passkey, aL as PasskeyWithMetadata, aN as Phone, ap as PhoneWithMetadata, aS as PriceDisplayOptions, P as PrivyErrorCode, ak as Quantity, ag as SmartWallet, e as SolanaCluster, j as SolanaFundingConfig, S as SolanaTransactionReceipt, k as SupportedSolanaTransaction, ay as Telegram, aJ as TelegramWithMetadata, ax as Tiktok, aF as TiktokOAuthWithMetadata, al as TransactionLog, am as TransactionReceipt, aO as TransactionUIOptions, as as Twitter, aC as TwitterOAuthWithMetadata, ae as TypedMessage, aq as WalletWithMetadata } from './types-B-zTuIEL.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';
|
|
@@ -14,8 +14,8 @@ import * as _simplewebauthn_types from '@simplewebauthn/types';
|
|
|
14
14
|
import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
|
|
15
15
|
import { Cluster } from '@solana/web3.js';
|
|
16
16
|
import { FetchOptions } from 'ofetch';
|
|
17
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
18
|
-
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
17
|
+
import { P as PrivyEvents } from './useSolanaWallets-DdM-QdoK.js';
|
|
18
|
+
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-DdM-QdoK.js';
|
|
19
19
|
import '@solana/wallet-adapter-base';
|
|
20
20
|
import '@privy-io/js-sdk-core';
|
|
21
21
|
import '@metamask/eth-sig-util';
|
|
@@ -292,6 +292,7 @@ type MfaSubmitEnrollmentRequestDataType = {
|
|
|
292
292
|
accessToken: string;
|
|
293
293
|
method: 'passkey';
|
|
294
294
|
credentialIds: string[];
|
|
295
|
+
removeForLogin?: boolean;
|
|
295
296
|
};
|
|
296
297
|
type MfaSubmitEnrollmentResponseDataType = Record<string, never>;
|
|
297
298
|
type MfaUnenrollRequestDataType = {
|
|
@@ -1735,10 +1736,13 @@ interface PrivyInterface {
|
|
|
1735
1736
|
* Submit the passkey to complete the enrollment process.
|
|
1736
1737
|
*
|
|
1737
1738
|
* @param meta {@link {credentialIds: string[]}} The passkey credentialIds to enroll in MFA.
|
|
1739
|
+
* @param options.removeForLogin (optional) If false, unenrolled passkeys will be kept linked to the user.
|
|
1738
1740
|
* @returns Promise for the MFA code submission.
|
|
1739
1741
|
*/
|
|
1740
|
-
submitEnrollmentWithPasskey: (
|
|
1742
|
+
submitEnrollmentWithPasskey: (input: {
|
|
1741
1743
|
credentialIds: string[];
|
|
1744
|
+
}, options?: {
|
|
1745
|
+
removeForLogin?: boolean;
|
|
1742
1746
|
}) => Promise<void>;
|
|
1743
1747
|
/**
|
|
1744
1748
|
* Triggers the MFA verification flow if the user has an MFA method enrolled.
|
|
@@ -1783,9 +1787,12 @@ interface PrivyInterface {
|
|
|
1783
1787
|
* Remove the MFA method for the current user.
|
|
1784
1788
|
*
|
|
1785
1789
|
* @param method {@link MfaMethod} The MFA method to remove for the current user.
|
|
1790
|
+
* @param options.removeForLogin (optional) If false, unenrolled passkeys will be kept linked to the user.
|
|
1786
1791
|
* @returns Promise for removing the MFA method for the current user.
|
|
1787
1792
|
*/
|
|
1788
|
-
unenroll: (method: MfaMethod
|
|
1793
|
+
unenroll: (method: MfaMethod, options?: {
|
|
1794
|
+
removeForLogin?: boolean;
|
|
1795
|
+
}) => Promise<void>;
|
|
1789
1796
|
/**
|
|
1790
1797
|
* Prompts a user to send a transaction using their embedded wallet.
|
|
1791
1798
|
*
|
|
@@ -2021,12 +2028,16 @@ declare function useMfaEnrollment(): {
|
|
|
2021
2028
|
submitEnrollmentWithTotp: (meta: {
|
|
2022
2029
|
mfaCode: string;
|
|
2023
2030
|
}) => Promise<void>;
|
|
2024
|
-
submitEnrollmentWithPasskey: (
|
|
2031
|
+
submitEnrollmentWithPasskey: (input: {
|
|
2025
2032
|
credentialIds: string[];
|
|
2033
|
+
}, options?: {
|
|
2034
|
+
removeForLogin?: boolean;
|
|
2026
2035
|
}) => Promise<void>;
|
|
2027
2036
|
unenrollWithSms: () => Promise<void>;
|
|
2028
2037
|
unenrollWithTotp: () => Promise<void>;
|
|
2029
|
-
unenrollWithPasskey: (
|
|
2038
|
+
unenrollWithPasskey: (options?: {
|
|
2039
|
+
removeForLogin?: boolean;
|
|
2040
|
+
}) => Promise<void>;
|
|
2030
2041
|
showMfaEnrollmentModal: () => void;
|
|
2031
2042
|
closeMfaEnrollmentModal: () => void;
|
|
2032
2043
|
};
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { MouseEvent } from 'react';
|
|
3
|
-
import { C as Chain, d as UserRecoveryMethod, m as PrivyFarcasterSignerInitResponse, n as MfaSubmitArgs, E as EthereumRpcRequestType, o as SolanaRpcRequestType, p as EthereumRpcResponseType, q as SolanaRpcResponseType, r as PrivyClientConfig, s as RpcConfig, u as EIP1193Provider, v as EntropyIdVerifier$1, w as RequestArguments, x as WalletTimeoutError, y as WalletConnector, B as BaseConnectedEthereumWallet, z as WalletClientType, A as ConnectedWalletMetadata, D as ConnectorType, G as WalletListEntry, H as ExternalWalletsConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, g as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a1 as PrivyServerConfig, a as LoginMethod, a2 as SiweWalletMetadata, a3 as TelegramAuthResult, a4 as TelegramWebAppData, a5 as OAuthUserInfo, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, f as ConnectedSolanaWallet, ad as CustomAuthFlowState } from './types-
|
|
4
|
-
export { aw as Apple, aH as AppleOAuthWithMetadata, aP as ContractUIOptions, az as CrossAppAccount, aK as CrossAppAccountWithMetadata, at as Discord, aD as DiscordOAuthWithMetadata, aM as Email, ao as EmailWithMetadata, aT as Farcaster, aI as FarcasterWithMetadata, au as Github, aE as GithubOAuthWithMetadata, ar as Google, aB as GoogleOAuthWithMetadata, aA as LinkedAccountType, b as LinkedAccountWithMetadata, av as LinkedIn, aG as LinkedInOAuthWithMetadata, aV as LoginMethodOrderOption, af as MessageTypes, ah as MoonpayConfig, ai as MoonpayCurrencyCode, aR as MoonpayFundingConfig, aj as MoonpayPaymentMethod, aQ as NativeFundingConfig, an as NonEmptyArray, aU as Passkey, aL as PasskeyWithMetadata, aN as Phone, ap as PhoneWithMetadata, aS as PriceDisplayOptions, P as PrivyErrorCode, ak as Quantity, ag as SmartWallet, e as SolanaCluster, j as SolanaFundingConfig, S as SolanaTransactionReceipt, k as SupportedSolanaTransaction, ay as Telegram, aJ as TelegramWithMetadata, ax as Tiktok, aF as TiktokOAuthWithMetadata, al as TransactionLog, am as TransactionReceipt, aO as TransactionUIOptions, as as Twitter, aC as TwitterOAuthWithMetadata, ae as TypedMessage, aq as WalletWithMetadata } from './types-
|
|
3
|
+
import { C as Chain, d as UserRecoveryMethod, m as PrivyFarcasterSignerInitResponse, n as MfaSubmitArgs, E as EthereumRpcRequestType, o as SolanaRpcRequestType, p as EthereumRpcResponseType, q as SolanaRpcResponseType, r as PrivyClientConfig, s as RpcConfig, u as EIP1193Provider, v as EntropyIdVerifier$1, w as RequestArguments, x as WalletTimeoutError, y as WalletConnector, B as BaseConnectedEthereumWallet, z as WalletClientType, A as ConnectedWalletMetadata, D as ConnectorType, G as WalletListEntry, H as ExternalWalletsConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, g as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a1 as PrivyServerConfig, a as LoginMethod, a2 as SiweWalletMetadata, a3 as TelegramAuthResult, a4 as TelegramWebAppData, a5 as OAuthUserInfo, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, f as ConnectedSolanaWallet, ad as CustomAuthFlowState } from './types-B-zTuIEL.js';
|
|
4
|
+
export { aw as Apple, aH as AppleOAuthWithMetadata, aP as ContractUIOptions, az as CrossAppAccount, aK as CrossAppAccountWithMetadata, at as Discord, aD as DiscordOAuthWithMetadata, aM as Email, ao as EmailWithMetadata, aT as Farcaster, aI as FarcasterWithMetadata, au as Github, aE as GithubOAuthWithMetadata, ar as Google, aB as GoogleOAuthWithMetadata, aA as LinkedAccountType, b as LinkedAccountWithMetadata, av as LinkedIn, aG as LinkedInOAuthWithMetadata, aV as LoginMethodOrderOption, af as MessageTypes, ah as MoonpayConfig, ai as MoonpayCurrencyCode, aR as MoonpayFundingConfig, aj as MoonpayPaymentMethod, aQ as NativeFundingConfig, an as NonEmptyArray, aU as Passkey, aL as PasskeyWithMetadata, aN as Phone, ap as PhoneWithMetadata, aS as PriceDisplayOptions, P as PrivyErrorCode, ak as Quantity, ag as SmartWallet, e as SolanaCluster, j as SolanaFundingConfig, S as SolanaTransactionReceipt, k as SupportedSolanaTransaction, ay as Telegram, aJ as TelegramWithMetadata, ax as Tiktok, aF as TiktokOAuthWithMetadata, al as TransactionLog, am as TransactionReceipt, aO as TransactionUIOptions, as as Twitter, aC as TwitterOAuthWithMetadata, ae as TypedMessage, aq as WalletWithMetadata } from './types-B-zTuIEL.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';
|
|
@@ -14,8 +14,8 @@ import * as _simplewebauthn_types from '@simplewebauthn/types';
|
|
|
14
14
|
import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
|
|
15
15
|
import { Cluster } from '@solana/web3.js';
|
|
16
16
|
import { FetchOptions } from 'ofetch';
|
|
17
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
18
|
-
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
17
|
+
import { P as PrivyEvents } from './useSolanaWallets-DdM-QdoK.js';
|
|
18
|
+
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-DdM-QdoK.js';
|
|
19
19
|
import '@solana/wallet-adapter-base';
|
|
20
20
|
import '@privy-io/js-sdk-core';
|
|
21
21
|
import '@metamask/eth-sig-util';
|
|
@@ -292,6 +292,7 @@ type MfaSubmitEnrollmentRequestDataType = {
|
|
|
292
292
|
accessToken: string;
|
|
293
293
|
method: 'passkey';
|
|
294
294
|
credentialIds: string[];
|
|
295
|
+
removeForLogin?: boolean;
|
|
295
296
|
};
|
|
296
297
|
type MfaSubmitEnrollmentResponseDataType = Record<string, never>;
|
|
297
298
|
type MfaUnenrollRequestDataType = {
|
|
@@ -1735,10 +1736,13 @@ interface PrivyInterface {
|
|
|
1735
1736
|
* Submit the passkey to complete the enrollment process.
|
|
1736
1737
|
*
|
|
1737
1738
|
* @param meta {@link {credentialIds: string[]}} The passkey credentialIds to enroll in MFA.
|
|
1739
|
+
* @param options.removeForLogin (optional) If false, unenrolled passkeys will be kept linked to the user.
|
|
1738
1740
|
* @returns Promise for the MFA code submission.
|
|
1739
1741
|
*/
|
|
1740
|
-
submitEnrollmentWithPasskey: (
|
|
1742
|
+
submitEnrollmentWithPasskey: (input: {
|
|
1741
1743
|
credentialIds: string[];
|
|
1744
|
+
}, options?: {
|
|
1745
|
+
removeForLogin?: boolean;
|
|
1742
1746
|
}) => Promise<void>;
|
|
1743
1747
|
/**
|
|
1744
1748
|
* Triggers the MFA verification flow if the user has an MFA method enrolled.
|
|
@@ -1783,9 +1787,12 @@ interface PrivyInterface {
|
|
|
1783
1787
|
* Remove the MFA method for the current user.
|
|
1784
1788
|
*
|
|
1785
1789
|
* @param method {@link MfaMethod} The MFA method to remove for the current user.
|
|
1790
|
+
* @param options.removeForLogin (optional) If false, unenrolled passkeys will be kept linked to the user.
|
|
1786
1791
|
* @returns Promise for removing the MFA method for the current user.
|
|
1787
1792
|
*/
|
|
1788
|
-
unenroll: (method: MfaMethod
|
|
1793
|
+
unenroll: (method: MfaMethod, options?: {
|
|
1794
|
+
removeForLogin?: boolean;
|
|
1795
|
+
}) => Promise<void>;
|
|
1789
1796
|
/**
|
|
1790
1797
|
* Prompts a user to send a transaction using their embedded wallet.
|
|
1791
1798
|
*
|
|
@@ -2021,12 +2028,16 @@ declare function useMfaEnrollment(): {
|
|
|
2021
2028
|
submitEnrollmentWithTotp: (meta: {
|
|
2022
2029
|
mfaCode: string;
|
|
2023
2030
|
}) => Promise<void>;
|
|
2024
|
-
submitEnrollmentWithPasskey: (
|
|
2031
|
+
submitEnrollmentWithPasskey: (input: {
|
|
2025
2032
|
credentialIds: string[];
|
|
2033
|
+
}, options?: {
|
|
2034
|
+
removeForLogin?: boolean;
|
|
2026
2035
|
}) => Promise<void>;
|
|
2027
2036
|
unenrollWithSms: () => Promise<void>;
|
|
2028
2037
|
unenrollWithTotp: () => Promise<void>;
|
|
2029
|
-
unenrollWithPasskey: (
|
|
2038
|
+
unenrollWithPasskey: (options?: {
|
|
2039
|
+
removeForLogin?: boolean;
|
|
2040
|
+
}) => Promise<void>;
|
|
2030
2041
|
showMfaEnrollmentModal: () => void;
|
|
2031
2042
|
closeMfaEnrollmentModal: () => void;
|
|
2032
2043
|
};
|
|
@@ -7,7 +7,7 @@ import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstract
|
|
|
7
7
|
import * as viem from 'viem';
|
|
8
8
|
import { SendTransactionParameters, Chain, Hash, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, Client } from 'viem';
|
|
9
9
|
import { SmartWalletType } from '@privy-io/js-sdk-core';
|
|
10
|
-
import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-
|
|
10
|
+
import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-B-zTuIEL.js';
|
|
11
11
|
import '@solana/wallet-adapter-base';
|
|
12
12
|
import '@privy-io/public-api';
|
|
13
13
|
import 'eventemitter3';
|
|
@@ -7,7 +7,7 @@ import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstract
|
|
|
7
7
|
import * as viem from 'viem';
|
|
8
8
|
import { SendTransactionParameters, Chain, Hash, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, Client } from 'viem';
|
|
9
9
|
import { SmartWalletType } from '@privy-io/js-sdk-core';
|
|
10
|
-
import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-
|
|
10
|
+
import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-B-zTuIEL.js';
|
|
11
11
|
import '@solana/wallet-adapter-base';
|
|
12
12
|
import '@privy-io/public-api';
|
|
13
13
|
import 'eventemitter3';
|
package/dist/dts/solana.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { W as Wallet, j as SolanaFundingConfig, k as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt } from './types-
|
|
2
|
-
export { f as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-
|
|
3
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
4
|
-
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
1
|
+
import { W as Wallet, j as SolanaFundingConfig, k as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt } from './types-B-zTuIEL.js';
|
|
2
|
+
export { f as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-B-zTuIEL.js';
|
|
3
|
+
import { P as PrivyEvents } from './useSolanaWallets-DdM-QdoK.js';
|
|
4
|
+
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-DdM-QdoK.js';
|
|
5
5
|
import { SendTransactionOptions } from '@solana/wallet-adapter-base';
|
|
6
6
|
import { Connection } from '@solana/web3.js';
|
|
7
7
|
import 'react';
|
package/dist/dts/solana.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { W as Wallet, j as SolanaFundingConfig, k as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt } from './types-
|
|
2
|
-
export { f as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-
|
|
3
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
4
|
-
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
1
|
+
import { W as Wallet, j as SolanaFundingConfig, k as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt } from './types-B-zTuIEL.js';
|
|
2
|
+
export { f as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-B-zTuIEL.js';
|
|
3
|
+
import { P as PrivyEvents } from './useSolanaWallets-DdM-QdoK.js';
|
|
4
|
+
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-DdM-QdoK.js';
|
|
5
5
|
import { SendTransactionOptions } from '@solana/wallet-adapter-base';
|
|
6
6
|
import { Connection } from '@solana/web3.js';
|
|
7
7
|
import 'react';
|
|
@@ -1514,6 +1514,13 @@ interface PrivyClientConfig {
|
|
|
1514
1514
|
noPromptOnMfaRequired?: boolean;
|
|
1515
1515
|
};
|
|
1516
1516
|
passkeys?: {
|
|
1517
|
+
/**
|
|
1518
|
+
* - If `true`, unenrolling a passkey from MFA will also remove it as a login method.
|
|
1519
|
+
* - If `false`, it will keep it as a login method as long as it has not been manually unlinked.
|
|
1520
|
+
*
|
|
1521
|
+
* @default true
|
|
1522
|
+
*/
|
|
1523
|
+
shouldUnlinkOnUnenrollMfa?: boolean;
|
|
1517
1524
|
/**
|
|
1518
1525
|
* - If `true`, unlinking a passkey as a login method will also unenroll it from MFA.
|
|
1519
1526
|
* - If `false`, it will keep it as an mfa method as long as it has not been manually unenrolled.
|
|
@@ -1514,6 +1514,13 @@ interface PrivyClientConfig {
|
|
|
1514
1514
|
noPromptOnMfaRequired?: boolean;
|
|
1515
1515
|
};
|
|
1516
1516
|
passkeys?: {
|
|
1517
|
+
/**
|
|
1518
|
+
* - If `true`, unenrolling a passkey from MFA will also remove it as a login method.
|
|
1519
|
+
* - If `false`, it will keep it as a login method as long as it has not been manually unlinked.
|
|
1520
|
+
*
|
|
1521
|
+
* @default true
|
|
1522
|
+
*/
|
|
1523
|
+
shouldUnlinkOnUnenrollMfa?: boolean;
|
|
1517
1524
|
/**
|
|
1518
1525
|
* - If `true`, unlinking a passkey as a login method will also unenroll it from MFA.
|
|
1519
1526
|
* - If `false`, it will keep it as an mfa method as long as it has not been manually unenrolled.
|
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, C as Chain } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions, C as Chain } from './types-B-zTuIEL.js';
|
|
3
3
|
import { Hex } from 'viem';
|
|
4
4
|
import { Cluster } from '@privy-io/js-sdk-core';
|
|
5
5
|
import '@solana/wallet-adapter-base';
|
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, C as Chain } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions, C as Chain } from './types-B-zTuIEL.js';
|
|
3
3
|
import { Hex } from 'viem';
|
|
4
4
|
import { Cluster } from '@privy-io/js-sdk-core';
|
|
5
5
|
import '@solana/wallet-adapter-base';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, O as OAuthTokens, C as Chain, F as FundingMethod, e as SolanaCluster, f as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-
|
|
1
|
+
import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, O as OAuthTokens, C as Chain, F as FundingMethod, e as SolanaCluster, f as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-B-zTuIEL.js';
|
|
2
2
|
import { MouseEvent } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, O as OAuthTokens, C as Chain, F as FundingMethod, e as SolanaCluster, f as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-
|
|
1
|
+
import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, O as OAuthTokens, C as Chain, F as FundingMethod, e as SolanaCluster, f as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-B-zTuIEL.js';
|
|
2
2
|
import { MouseEvent } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|