@crossmint/client-sdk-react-ui 1.9.2 → 1.10.0
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/chunk-2LTCJUPK.cjs +31 -0
- package/dist/chunk-2LTCJUPK.cjs.map +1 -0
- package/dist/chunk-2QB7GW4K.cjs +64 -0
- package/dist/chunk-2QB7GW4K.cjs.map +1 -0
- package/dist/chunk-2T2VCED7.js +17 -0
- package/dist/chunk-2T2VCED7.js.map +1 -0
- package/dist/chunk-33WZFL2D.js +80 -0
- package/dist/chunk-33WZFL2D.js.map +1 -0
- package/dist/chunk-35RV5AOT.cjs +70 -0
- package/dist/chunk-35RV5AOT.cjs.map +1 -0
- package/dist/chunk-3J6CUUWT.js +50 -0
- package/dist/chunk-3J6CUUWT.js.map +1 -0
- package/dist/chunk-3KR4GYLF.js +26 -0
- package/dist/chunk-3KR4GYLF.js.map +1 -0
- package/dist/chunk-3RXUFZTR.cjs +14 -0
- package/dist/chunk-3RXUFZTR.cjs.map +1 -0
- package/dist/chunk-43P7QWBK.cjs +17 -0
- package/dist/chunk-43P7QWBK.cjs.map +1 -0
- package/dist/chunk-46UDUOKJ.cjs +10 -0
- package/dist/chunk-46UDUOKJ.cjs.map +1 -0
- package/dist/chunk-4DAZAO6Y.cjs +59 -0
- package/dist/chunk-4DAZAO6Y.cjs.map +1 -0
- package/dist/chunk-5JAEV6YP.js +81 -0
- package/dist/chunk-5JAEV6YP.js.map +1 -0
- package/dist/chunk-5KK3YQWD.cjs +1 -0
- package/dist/chunk-5KK3YQWD.cjs.map +1 -0
- package/dist/chunk-5RX5WFEW.cjs +11 -0
- package/dist/chunk-5RX5WFEW.cjs.map +1 -0
- package/dist/chunk-5S4VO6RB.cjs +55 -0
- package/dist/chunk-5S4VO6RB.cjs.map +1 -0
- package/dist/chunk-5VZNJ4VT.js +36 -0
- package/dist/chunk-5VZNJ4VT.js.map +1 -0
- package/dist/chunk-657ZCQSH.cjs +31 -0
- package/dist/chunk-657ZCQSH.cjs.map +1 -0
- package/dist/chunk-6DNBJVR5.js +64 -0
- package/dist/chunk-6DNBJVR5.js.map +1 -0
- package/dist/chunk-6LO4NSRH.cjs +21 -0
- package/dist/chunk-6LO4NSRH.cjs.map +1 -0
- package/dist/chunk-7KIY6DLW.js +28 -0
- package/dist/chunk-7KIY6DLW.js.map +1 -0
- package/dist/chunk-7SBZ6OIH.js +1 -0
- package/dist/chunk-7SBZ6OIH.js.map +1 -0
- package/dist/chunk-A2JCJ2OV.cjs +119 -0
- package/dist/chunk-A2JCJ2OV.cjs.map +1 -0
- package/dist/chunk-A7J4DAE7.js +16 -0
- package/dist/chunk-A7J4DAE7.js.map +1 -0
- package/dist/chunk-ATHR4S2P.js +48 -0
- package/dist/chunk-ATHR4S2P.js.map +1 -0
- package/dist/chunk-AUEQQ4D3.js +119 -0
- package/dist/chunk-AUEQQ4D3.js.map +1 -0
- package/dist/chunk-AXZLLRBU.cjs +26 -0
- package/dist/chunk-AXZLLRBU.cjs.map +1 -0
- package/dist/chunk-B7LYPQ4K.cjs +38 -0
- package/dist/chunk-B7LYPQ4K.cjs.map +1 -0
- package/dist/chunk-BE2ZLB3L.cjs +19 -0
- package/dist/chunk-BE2ZLB3L.cjs.map +1 -0
- package/dist/chunk-BJIMCGIQ.js +22 -0
- package/dist/chunk-BJIMCGIQ.js.map +1 -0
- package/dist/chunk-BKVDVDKX.cjs +1 -0
- package/dist/chunk-BKVDVDKX.cjs.map +1 -0
- package/dist/chunk-BYRVAFBZ.cjs +52 -0
- package/dist/chunk-BYRVAFBZ.cjs.map +1 -0
- package/dist/chunk-C2VARNXL.js +70 -0
- package/dist/chunk-C2VARNXL.js.map +1 -0
- package/dist/chunk-CIZ2K2TA.cjs +81 -0
- package/dist/chunk-CIZ2K2TA.cjs.map +1 -0
- package/dist/chunk-CPYPI45H.js +98 -0
- package/dist/chunk-CPYPI45H.js.map +1 -0
- package/dist/chunk-CRTRMMJ7.js +59 -0
- package/dist/chunk-CRTRMMJ7.js.map +1 -0
- package/dist/chunk-CUODMU27.js +1265 -0
- package/dist/chunk-CUODMU27.js.map +1 -0
- package/dist/chunk-CYUTXV7Z.js +17 -0
- package/dist/chunk-CYUTXV7Z.js.map +1 -0
- package/dist/chunk-DJ32OEWG.cjs +54 -0
- package/dist/chunk-DJ32OEWG.cjs.map +1 -0
- package/dist/chunk-DZ5MGN25.js +147 -0
- package/dist/chunk-DZ5MGN25.js.map +1 -0
- package/dist/chunk-E3BR6DXY.js +153 -0
- package/dist/chunk-E3BR6DXY.js.map +1 -0
- package/dist/chunk-ENCR5SUW.cjs +51 -0
- package/dist/chunk-ENCR5SUW.cjs.map +1 -0
- package/dist/chunk-EOWJ7775.js +18 -0
- package/dist/chunk-EOWJ7775.js.map +1 -0
- package/dist/chunk-EVL7VEPX.js +14 -0
- package/dist/chunk-EVL7VEPX.js.map +1 -0
- package/dist/chunk-FH7TEEZR.js +52 -0
- package/dist/chunk-FH7TEEZR.js.map +1 -0
- package/dist/chunk-FKIMKZ4Y.js +17 -0
- package/dist/chunk-FKIMKZ4Y.js.map +1 -0
- package/dist/chunk-FOCUIKYH.cjs +1265 -0
- package/dist/chunk-FOCUIKYH.cjs.map +1 -0
- package/dist/chunk-GY6G3ZC2.cjs +41 -0
- package/dist/chunk-GY6G3ZC2.cjs.map +1 -0
- package/dist/chunk-GZRGZKN6.js +31 -0
- package/dist/chunk-GZRGZKN6.js.map +1 -0
- package/dist/chunk-H4F7UVPT.js +34 -0
- package/dist/chunk-H4F7UVPT.js.map +1 -0
- package/dist/chunk-HATQVB6H.js +19 -0
- package/dist/chunk-HATQVB6H.js.map +1 -0
- package/dist/chunk-HCW4RO2O.cjs +29 -0
- package/dist/chunk-HCW4RO2O.cjs.map +1 -0
- package/dist/chunk-HPOZ6I54.cjs +44 -0
- package/dist/chunk-HPOZ6I54.cjs.map +1 -0
- package/dist/chunk-I63FQCIV.js +189 -0
- package/dist/chunk-I63FQCIV.js.map +1 -0
- package/dist/chunk-IP4HQL5I.cjs +147 -0
- package/dist/chunk-IP4HQL5I.cjs.map +1 -0
- package/dist/chunk-IQPA3QOV.js +27 -0
- package/dist/chunk-IQPA3QOV.js.map +1 -0
- package/dist/chunk-IVNGVLGR.cjs +153 -0
- package/dist/chunk-IVNGVLGR.cjs.map +1 -0
- package/dist/chunk-KAXBBO66.cjs +30 -0
- package/dist/chunk-KAXBBO66.cjs.map +1 -0
- package/dist/chunk-KEKBOJCF.cjs +50 -0
- package/dist/chunk-KEKBOJCF.cjs.map +1 -0
- package/dist/chunk-KLWDDALZ.cjs +14 -0
- package/dist/chunk-KLWDDALZ.cjs.map +1 -0
- package/dist/chunk-KNOUJZN5.cjs +32 -0
- package/dist/chunk-KNOUJZN5.cjs.map +1 -0
- package/dist/chunk-L3FKENHU.js +14 -0
- package/dist/chunk-L3FKENHU.js.map +1 -0
- package/dist/chunk-LKO5WR7D.js +64 -0
- package/dist/chunk-LKO5WR7D.js.map +1 -0
- package/dist/chunk-MH37OJT2.cjs +80 -0
- package/dist/chunk-MH37OJT2.cjs.map +1 -0
- package/dist/chunk-MJHLKJ6X.cjs +212 -0
- package/dist/chunk-MJHLKJ6X.cjs.map +1 -0
- package/dist/chunk-MUS7DUPS.cjs +98 -0
- package/dist/chunk-MUS7DUPS.cjs.map +1 -0
- package/dist/chunk-NMXFWIFA.js +133 -0
- package/dist/chunk-NMXFWIFA.js.map +1 -0
- package/dist/chunk-ODH26VGS.js +50 -0
- package/dist/chunk-ODH26VGS.js.map +1 -0
- package/dist/chunk-OPIHF55A.cjs +50 -0
- package/dist/chunk-OPIHF55A.cjs.map +1 -0
- package/dist/chunk-OZS4WEKF.js +55 -0
- package/dist/chunk-OZS4WEKF.js.map +1 -0
- package/dist/chunk-PBSL6JOF.cjs +17 -0
- package/dist/chunk-PBSL6JOF.cjs.map +1 -0
- package/dist/chunk-PHCGCJSA.js +107 -0
- package/dist/chunk-PHCGCJSA.js.map +1 -0
- package/dist/chunk-Q3M4UH5U.cjs +48 -0
- package/dist/chunk-Q3M4UH5U.cjs.map +1 -0
- package/dist/chunk-QDKAU3H2.js +31 -0
- package/dist/chunk-QDKAU3H2.js.map +1 -0
- package/dist/chunk-QFQWKKVU.js +11 -0
- package/dist/chunk-QFQWKKVU.js.map +1 -0
- package/dist/chunk-QJ44PL7L.js +41 -0
- package/dist/chunk-QJ44PL7L.js.map +1 -0
- package/dist/chunk-QK5J7FD3.cjs +11 -0
- package/dist/chunk-QK5J7FD3.cjs.map +1 -0
- package/dist/chunk-QQXBYOKA.cjs +16 -0
- package/dist/chunk-QQXBYOKA.cjs.map +1 -0
- package/dist/chunk-QT7UEJZG.cjs +133 -0
- package/dist/chunk-QT7UEJZG.cjs.map +1 -0
- package/dist/chunk-QTL5I5C2.js +38 -0
- package/dist/chunk-QTL5I5C2.js.map +1 -0
- package/dist/chunk-R6IL3WOE.cjs +31 -0
- package/dist/chunk-R6IL3WOE.cjs.map +1 -0
- package/dist/chunk-REUYMHNW.cjs +136 -0
- package/dist/chunk-REUYMHNW.cjs.map +1 -0
- package/dist/chunk-RWS44QDX.js +31 -0
- package/dist/chunk-RWS44QDX.js.map +1 -0
- package/dist/chunk-RZPQIRIY.js +11 -0
- package/dist/chunk-RZPQIRIY.js.map +1 -0
- package/dist/chunk-RZT2J42J.js +29 -0
- package/dist/chunk-RZT2J42J.js.map +1 -0
- package/dist/chunk-SBA6FMFT.cjs +18 -0
- package/dist/chunk-SBA6FMFT.cjs.map +1 -0
- package/dist/chunk-SZA3XDJ5.cjs +1 -0
- package/dist/chunk-SZA3XDJ5.cjs.map +1 -0
- package/dist/chunk-U2D3L4DZ.cjs +17 -0
- package/dist/chunk-U2D3L4DZ.cjs.map +1 -0
- package/dist/chunk-U5EONMPH.js +30 -0
- package/dist/chunk-U5EONMPH.js.map +1 -0
- package/dist/chunk-UASNCH3A.cjs +27 -0
- package/dist/chunk-UASNCH3A.cjs.map +1 -0
- package/dist/chunk-UC3GWTEN.js +136 -0
- package/dist/chunk-UC3GWTEN.js.map +1 -0
- package/dist/chunk-UCQ5VAPT.cjs +36 -0
- package/dist/chunk-UCQ5VAPT.cjs.map +1 -0
- package/dist/chunk-UQAKJ4T7.cjs +29 -0
- package/dist/chunk-UQAKJ4T7.cjs.map +1 -0
- package/dist/chunk-URKPLEPV.cjs +189 -0
- package/dist/chunk-URKPLEPV.cjs.map +1 -0
- package/dist/chunk-VWRC3IFZ.cjs +22 -0
- package/dist/chunk-VWRC3IFZ.cjs.map +1 -0
- package/dist/chunk-VZIXXIU5.js +32 -0
- package/dist/chunk-VZIXXIU5.js.map +1 -0
- package/dist/chunk-WK5RAFJ3.js +54 -0
- package/dist/chunk-WK5RAFJ3.js.map +1 -0
- package/dist/chunk-XDJ6F7N4.cjs +107 -0
- package/dist/chunk-XDJ6F7N4.cjs.map +1 -0
- package/dist/chunk-XEZF7G64.js +212 -0
- package/dist/chunk-XEZF7G64.js.map +1 -0
- package/dist/chunk-XXJ7LQ44.js +1 -0
- package/dist/chunk-XXJ7LQ44.js.map +1 -0
- package/dist/chunk-XYMYRPVT.js +1 -0
- package/dist/chunk-XYMYRPVT.js.map +1 -0
- package/dist/chunk-YB66RCZP.js +10 -0
- package/dist/chunk-YB66RCZP.js.map +1 -0
- package/dist/chunk-YE55IKBP.cjs +34 -0
- package/dist/chunk-YE55IKBP.cjs.map +1 -0
- package/dist/chunk-YWVQCHQF.js +51 -0
- package/dist/chunk-YWVQCHQF.js.map +1 -0
- package/dist/chunk-ZCYU7QA6.cjs +64 -0
- package/dist/chunk-ZCYU7QA6.cjs.map +1 -0
- package/dist/chunk-ZDQGQY7Z.js +29 -0
- package/dist/chunk-ZDQGQY7Z.js.map +1 -0
- package/dist/chunk-ZIHCLVCD.js +44 -0
- package/dist/chunk-ZIHCLVCD.js.map +1 -0
- package/dist/chunk-ZMSST6ZZ.cjs +28 -0
- package/dist/chunk-ZMSST6ZZ.cjs.map +1 -0
- package/dist/chunk-ZUIS3FET.js +21 -0
- package/dist/chunk-ZUIS3FET.js.map +1 -0
- package/dist/components/CrossmintNFTCollectionView.cjs +9 -0
- package/dist/components/CrossmintNFTCollectionView.cjs.map +1 -0
- package/dist/components/CrossmintNFTCollectionView.d.cts +6 -0
- package/dist/components/CrossmintNFTCollectionView.d.ts +6 -0
- package/dist/components/CrossmintNFTCollectionView.js +9 -0
- package/dist/components/CrossmintNFTCollectionView.js.map +1 -0
- package/dist/components/CrossmintNFTDetail.cjs +9 -0
- package/dist/components/CrossmintNFTDetail.cjs.map +1 -0
- package/dist/components/CrossmintNFTDetail.d.cts +6 -0
- package/dist/components/CrossmintNFTDetail.d.ts +6 -0
- package/dist/components/CrossmintNFTDetail.js +9 -0
- package/dist/components/CrossmintNFTDetail.js.map +1 -0
- package/dist/components/auth/AuthForm.cjs +37 -0
- package/dist/components/auth/AuthForm.cjs.map +1 -0
- package/dist/components/auth/AuthForm.d.cts +7 -0
- package/dist/components/auth/AuthForm.d.ts +7 -0
- package/dist/components/auth/AuthForm.js +37 -0
- package/dist/components/auth/AuthForm.js.map +1 -0
- package/dist/components/auth/AuthFormBackButton.cjs +10 -0
- package/dist/components/auth/AuthFormBackButton.cjs.map +1 -0
- package/dist/components/auth/AuthFormBackButton.d.cts +9 -0
- package/dist/components/auth/AuthFormBackButton.d.ts +9 -0
- package/dist/components/auth/AuthFormBackButton.js +10 -0
- package/dist/components/auth/AuthFormBackButton.js.map +1 -0
- package/dist/components/auth/AuthFormDialog.cjs +37 -0
- package/dist/components/auth/AuthFormDialog.cjs.map +1 -0
- package/dist/components/auth/AuthFormDialog.d.cts +7 -0
- package/dist/components/auth/AuthFormDialog.d.ts +7 -0
- package/dist/components/auth/AuthFormDialog.js +37 -0
- package/dist/components/auth/AuthFormDialog.js.map +1 -0
- package/dist/components/auth/EmbeddedAuthForm.cjs +38 -0
- package/dist/components/auth/EmbeddedAuthForm.cjs.map +1 -0
- package/dist/components/auth/EmbeddedAuthForm.d.cts +5 -0
- package/dist/components/auth/EmbeddedAuthForm.d.ts +5 -0
- package/dist/components/auth/EmbeddedAuthForm.js +38 -0
- package/dist/components/auth/EmbeddedAuthForm.js.map +1 -0
- package/dist/components/auth/PasskeyPrompt.cjs +14 -0
- package/dist/components/auth/PasskeyPrompt.cjs.map +1 -0
- package/dist/components/auth/PasskeyPrompt.d.cts +15 -0
- package/dist/components/auth/PasskeyPrompt.d.ts +15 -0
- package/dist/components/auth/PasskeyPrompt.js +14 -0
- package/dist/components/auth/PasskeyPrompt.js.map +1 -0
- package/dist/components/auth/methods/email/EmailAuthFlow.cjs +37 -0
- package/dist/components/auth/methods/email/EmailAuthFlow.cjs.map +1 -0
- package/dist/components/auth/methods/email/EmailAuthFlow.d.cts +5 -0
- package/dist/components/auth/methods/email/EmailAuthFlow.d.ts +5 -0
- package/dist/components/auth/methods/email/EmailAuthFlow.js +37 -0
- package/dist/components/auth/methods/email/EmailAuthFlow.js.map +1 -0
- package/dist/components/auth/methods/email/EmailOTPInput.cjs +39 -0
- package/dist/components/auth/methods/email/EmailOTPInput.cjs.map +1 -0
- package/dist/components/auth/methods/email/EmailOTPInput.d.cts +10 -0
- package/dist/components/auth/methods/email/EmailOTPInput.d.ts +10 -0
- package/dist/components/auth/methods/email/EmailOTPInput.js +39 -0
- package/dist/components/auth/methods/email/EmailOTPInput.js.map +1 -0
- package/dist/components/auth/methods/email/EmailSignIn.cjs +37 -0
- package/dist/components/auth/methods/email/EmailSignIn.cjs.map +1 -0
- package/dist/components/auth/methods/email/EmailSignIn.d.cts +8 -0
- package/dist/components/auth/methods/email/EmailSignIn.d.ts +8 -0
- package/dist/components/auth/methods/email/EmailSignIn.js +37 -0
- package/dist/components/auth/methods/email/EmailSignIn.js.map +1 -0
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.cjs +37 -0
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.cjs.map +1 -0
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.d.cts +5 -0
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.d.ts +5 -0
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.js +37 -0
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.js.map +1 -0
- package/dist/components/auth/methods/google/GoogleSignIn.cjs +37 -0
- package/dist/components/auth/methods/google/GoogleSignIn.cjs.map +1 -0
- package/dist/components/auth/methods/google/GoogleSignIn.d.cts +6 -0
- package/dist/components/auth/methods/google/GoogleSignIn.d.ts +6 -0
- package/dist/components/auth/methods/google/GoogleSignIn.js +37 -0
- package/dist/components/auth/methods/google/GoogleSignIn.js.map +1 -0
- package/dist/components/auth/methods/web3/Web3AuthFlow.cjs +37 -0
- package/dist/components/auth/methods/web3/Web3AuthFlow.cjs.map +1 -0
- package/dist/components/auth/methods/web3/Web3AuthFlow.d.cts +5 -0
- package/dist/components/auth/methods/web3/Web3AuthFlow.d.ts +5 -0
- package/dist/components/auth/methods/web3/Web3AuthFlow.js +37 -0
- package/dist/components/auth/methods/web3/Web3AuthFlow.js.map +1 -0
- package/dist/components/auth/methods/web3/Web3AuthWrapper.cjs +37 -0
- package/dist/components/auth/methods/web3/Web3AuthWrapper.cjs.map +1 -0
- package/dist/components/auth/methods/web3/Web3AuthWrapper.d.cts +10 -0
- package/dist/components/auth/methods/web3/Web3AuthWrapper.d.ts +10 -0
- package/dist/components/auth/methods/web3/Web3AuthWrapper.js +37 -0
- package/dist/components/auth/methods/web3/Web3AuthWrapper.js.map +1 -0
- package/dist/components/auth/methods/web3/Web3ConnectButton.cjs +11 -0
- package/dist/components/auth/methods/web3/Web3ConnectButton.cjs.map +1 -0
- package/dist/components/auth/methods/web3/Web3ConnectButton.d.cts +13 -0
- package/dist/components/auth/methods/web3/Web3ConnectButton.d.ts +13 -0
- package/dist/components/auth/methods/web3/Web3ConnectButton.js +11 -0
- package/dist/components/auth/methods/web3/Web3ConnectButton.js.map +1 -0
- package/dist/components/auth/methods/web3/Web3Connectors.cjs +37 -0
- package/dist/components/auth/methods/web3/Web3Connectors.cjs.map +1 -0
- package/dist/components/auth/methods/web3/Web3Connectors.d.cts +5 -0
- package/dist/components/auth/methods/web3/Web3Connectors.d.ts +5 -0
- package/dist/components/auth/methods/web3/Web3Connectors.js +37 -0
- package/dist/components/auth/methods/web3/Web3Connectors.js.map +1 -0
- package/dist/components/auth/methods/web3/Web3ProviderButton.cjs +9 -0
- package/dist/components/auth/methods/web3/Web3ProviderButton.cjs.map +1 -0
- package/dist/components/auth/methods/web3/Web3ProviderButton.d.cts +11 -0
- package/dist/components/auth/methods/web3/Web3ProviderButton.d.ts +11 -0
- package/dist/components/auth/methods/web3/Web3ProviderButton.js +9 -0
- package/dist/components/auth/methods/web3/Web3ProviderButton.js.map +1 -0
- package/dist/components/auth/methods/web3/Web3SignIn.cjs +37 -0
- package/dist/components/auth/methods/web3/Web3SignIn.cjs.map +1 -0
- package/dist/components/auth/methods/web3/Web3SignIn.d.cts +5 -0
- package/dist/components/auth/methods/web3/Web3SignIn.d.ts +5 -0
- package/dist/components/auth/methods/web3/Web3SignIn.js +37 -0
- package/dist/components/auth/methods/web3/Web3SignIn.js.map +1 -0
- package/dist/components/common/Dialog.cjs +26 -0
- package/dist/components/common/Dialog.cjs.map +1 -0
- package/dist/components/common/Dialog.d.cts +26 -0
- package/dist/components/common/Dialog.d.ts +26 -0
- package/dist/components/common/Dialog.js +26 -0
- package/dist/components/common/Dialog.js.map +1 -0
- package/dist/components/common/Divider.cjs +37 -0
- package/dist/components/common/Divider.cjs.map +1 -0
- package/dist/components/common/Divider.d.cts +9 -0
- package/dist/components/common/Divider.d.ts +9 -0
- package/dist/components/common/Divider.js +37 -0
- package/dist/components/common/Divider.js.map +1 -0
- package/dist/components/common/InputOTP.cjs +14 -0
- package/dist/components/common/InputOTP.cjs.map +1 -0
- package/dist/components/common/InputOTP.d.cts +24 -0
- package/dist/components/common/InputOTP.d.ts +24 -0
- package/dist/components/common/InputOTP.js +14 -0
- package/dist/components/common/InputOTP.js.map +1 -0
- package/dist/components/common/PoweredByCrossmint.cjs +10 -0
- package/dist/components/common/PoweredByCrossmint.cjs.map +1 -0
- package/dist/components/common/PoweredByCrossmint.d.cts +8 -0
- package/dist/components/common/PoweredByCrossmint.d.ts +8 -0
- package/dist/components/common/PoweredByCrossmint.js +10 -0
- package/dist/components/common/PoweredByCrossmint.js.map +1 -0
- package/dist/components/common/Spinner.cjs +9 -0
- package/dist/components/common/Spinner.cjs.map +1 -0
- package/dist/components/common/Spinner.d.cts +9 -0
- package/dist/components/common/Spinner.d.ts +9 -0
- package/dist/components/common/Spinner.js +9 -0
- package/dist/components/common/Spinner.js.map +1 -0
- package/dist/components/dynamic-xyz/DynamicContextProviderWrapper.cjs +8 -0
- package/dist/components/dynamic-xyz/DynamicContextProviderWrapper.cjs.map +1 -0
- package/dist/components/dynamic-xyz/DynamicContextProviderWrapper.d.cts +13 -0
- package/dist/components/dynamic-xyz/DynamicContextProviderWrapper.d.ts +13 -0
- package/dist/components/dynamic-xyz/DynamicContextProviderWrapper.js +8 -0
- package/dist/components/dynamic-xyz/DynamicContextProviderWrapper.js.map +1 -0
- package/dist/components/embed/EmbeddedCheckoutIFrame.cjs +8 -0
- package/dist/components/embed/EmbeddedCheckoutIFrame.cjs.map +1 -0
- package/dist/components/embed/EmbeddedCheckoutIFrame.d.cts +9 -0
- package/dist/components/embed/EmbeddedCheckoutIFrame.d.ts +9 -0
- package/dist/components/embed/EmbeddedCheckoutIFrame.js +8 -0
- package/dist/components/embed/EmbeddedCheckoutIFrame.js.map +1 -0
- package/dist/components/embed/crypto/CryptoEmbeddedCheckout.cjs +11 -0
- package/dist/components/embed/crypto/CryptoEmbeddedCheckout.cjs.map +1 -0
- package/dist/components/embed/crypto/CryptoEmbeddedCheckout.d.cts +6 -0
- package/dist/components/embed/crypto/CryptoEmbeddedCheckout.d.ts +6 -0
- package/dist/components/embed/crypto/CryptoEmbeddedCheckout.js +11 -0
- package/dist/components/embed/crypto/CryptoEmbeddedCheckout.js.map +1 -0
- package/dist/components/embed/crypto/CryptoEmbeddedCheckoutIFrame.cjs +10 -0
- package/dist/components/embed/crypto/CryptoEmbeddedCheckoutIFrame.cjs.map +1 -0
- package/dist/components/embed/crypto/CryptoEmbeddedCheckoutIFrame.d.cts +6 -0
- package/dist/components/embed/crypto/CryptoEmbeddedCheckoutIFrame.d.ts +6 -0
- package/dist/components/embed/crypto/CryptoEmbeddedCheckoutIFrame.js +10 -0
- package/dist/components/embed/crypto/CryptoEmbeddedCheckoutIFrame.js.map +1 -0
- package/dist/components/embed/fiat/FiatEmbeddedCheckout.cjs +11 -0
- package/dist/components/embed/fiat/FiatEmbeddedCheckout.cjs.map +1 -0
- package/dist/components/embed/fiat/FiatEmbeddedCheckout.d.cts +6 -0
- package/dist/components/embed/fiat/FiatEmbeddedCheckout.d.ts +6 -0
- package/dist/components/embed/fiat/FiatEmbeddedCheckout.js +11 -0
- package/dist/components/embed/fiat/FiatEmbeddedCheckout.js.map +1 -0
- package/dist/components/embed/fiat/FiatEmbeddedCheckoutIFrame.cjs +10 -0
- package/dist/components/embed/fiat/FiatEmbeddedCheckoutIFrame.cjs.map +1 -0
- package/dist/components/embed/fiat/FiatEmbeddedCheckoutIFrame.d.cts +6 -0
- package/dist/components/embed/fiat/FiatEmbeddedCheckoutIFrame.d.ts +6 -0
- package/dist/components/embed/fiat/FiatEmbeddedCheckoutIFrame.js +10 -0
- package/dist/components/embed/fiat/FiatEmbeddedCheckoutIFrame.js.map +1 -0
- package/dist/components/embed/fiat/FiatPaymentElement_OLD.cjs +75 -0
- package/dist/components/embed/fiat/FiatPaymentElement_OLD.cjs.map +1 -0
- package/dist/components/embed/fiat/FiatPaymentElement_OLD.d.cts +6 -0
- package/dist/components/embed/fiat/FiatPaymentElement_OLD.d.ts +6 -0
- package/dist/components/embed/fiat/FiatPaymentElement_OLD.js +75 -0
- package/dist/components/embed/fiat/FiatPaymentElement_OLD.js.map +1 -0
- package/dist/components/embed/index.cjs +14 -0
- package/dist/components/embed/index.cjs.map +1 -0
- package/dist/components/embed/index.d.cts +6 -0
- package/dist/components/embed/index.d.ts +6 -0
- package/dist/components/embed/index.js +14 -0
- package/dist/components/embed/index.js.map +1 -0
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.cjs +44 -0
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.cjs.map +1 -0
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.d.cts +6 -0
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.d.ts +6 -0
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +44 -0
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js.map +1 -0
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.cjs +43 -0
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.cjs.map +1 -0
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.d.cts +6 -0
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.d.ts +6 -0
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.js +43 -0
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.js.map +1 -0
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs +12 -0
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs.map +1 -0
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.d.cts +10 -0
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.d.ts +10 -0
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.js +12 -0
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.js.map +1 -0
- package/dist/components/embed/v3/crypto/utils/handleEvmTransaction.cjs +8 -0
- package/dist/components/embed/v3/crypto/utils/handleEvmTransaction.cjs.map +1 -0
- package/dist/components/embed/v3/crypto/utils/handleEvmTransaction.d.cts +12 -0
- package/dist/components/embed/v3/crypto/utils/handleEvmTransaction.d.ts +12 -0
- package/dist/components/embed/v3/crypto/utils/handleEvmTransaction.js +8 -0
- package/dist/components/embed/v3/crypto/utils/handleEvmTransaction.js.map +1 -0
- package/dist/components/embed/v3/crypto/utils/handleSendTransaction.cjs +10 -0
- package/dist/components/embed/v3/crypto/utils/handleSendTransaction.cjs.map +1 -0
- package/dist/components/embed/v3/crypto/utils/handleSendTransaction.d.cts +7 -0
- package/dist/components/embed/v3/crypto/utils/handleSendTransaction.d.ts +7 -0
- package/dist/components/embed/v3/crypto/utils/handleSendTransaction.js +10 -0
- package/dist/components/embed/v3/crypto/utils/handleSendTransaction.js.map +1 -0
- package/dist/components/embed/v3/crypto/utils/handleSolanaTransaction.cjs +8 -0
- package/dist/components/embed/v3/crypto/utils/handleSolanaTransaction.cjs.map +1 -0
- package/dist/components/embed/v3/crypto/utils/handleSolanaTransaction.d.cts +10 -0
- package/dist/components/embed/v3/crypto/utils/handleSolanaTransaction.d.ts +10 -0
- package/dist/components/embed/v3/crypto/utils/handleSolanaTransaction.js +8 -0
- package/dist/components/embed/v3/crypto/utils/handleSolanaTransaction.js.map +1 -0
- package/dist/components/embed/v3/index.cjs +45 -0
- package/dist/components/embed/v3/index.cjs.map +1 -0
- package/dist/components/embed/v3/index.d.cts +3 -0
- package/dist/components/embed/v3/index.d.ts +3 -0
- package/dist/components/embed/v3/index.js +45 -0
- package/dist/components/embed/v3/index.js.map +1 -0
- package/dist/components/hosted/CrossmintPayButton.cjs +11 -0
- package/dist/components/hosted/CrossmintPayButton.cjs.map +1 -0
- package/dist/components/hosted/CrossmintPayButton.d.cts +11 -0
- package/dist/components/hosted/CrossmintPayButton.d.ts +11 -0
- package/dist/components/hosted/CrossmintPayButton.js +11 -0
- package/dist/components/hosted/CrossmintPayButton.js.map +1 -0
- package/dist/components/hosted/index.cjs +12 -0
- package/dist/components/hosted/index.cjs.map +1 -0
- package/dist/components/hosted/index.d.cts +4 -0
- package/dist/components/hosted/index.d.ts +4 -0
- package/dist/components/hosted/index.js +12 -0
- package/dist/components/hosted/index.js.map +1 -0
- package/dist/components/hosted/styles.cjs +10 -0
- package/dist/components/hosted/styles.cjs.map +1 -0
- package/dist/components/hosted/styles.d.cts +11 -0
- package/dist/components/hosted/styles.d.ts +11 -0
- package/dist/components/hosted/styles.js +10 -0
- package/dist/components/hosted/styles.js.map +1 -0
- package/dist/components/index.cjs +75 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.cts +10 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +75 -0
- package/dist/components/index.js.map +1 -0
- package/dist/consts/version.cjs +8 -0
- package/dist/consts/version.cjs.map +1 -0
- package/dist/consts/version.d.cts +3 -0
- package/dist/consts/version.d.ts +3 -0
- package/dist/consts/version.js +8 -0
- package/dist/consts/version.js.map +1 -0
- package/dist/hooks/index.cjs +49 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +13 -0
- package/dist/hooks/index.d.ts +13 -0
- package/dist/hooks/index.js +49 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useAuth.cjs +37 -0
- package/dist/hooks/useAuth.cjs.map +1 -0
- package/dist/hooks/useAuth.d.cts +11 -0
- package/dist/hooks/useAuth.d.ts +11 -0
- package/dist/hooks/useAuth.js +37 -0
- package/dist/hooks/useAuth.js.map +1 -0
- package/dist/hooks/useCrossmint.cjs +10 -0
- package/dist/hooks/useCrossmint.cjs.map +1 -0
- package/dist/hooks/useCrossmint.d.cts +14 -0
- package/dist/hooks/useCrossmint.d.ts +14 -0
- package/dist/hooks/useCrossmint.js +10 -0
- package/dist/hooks/useCrossmint.js.map +1 -0
- package/dist/hooks/useCrossmintAuth.cjs +37 -0
- package/dist/hooks/useCrossmintAuth.cjs.map +1 -0
- package/dist/hooks/useCrossmintAuth.d.cts +11 -0
- package/dist/hooks/useCrossmintAuth.d.ts +11 -0
- package/dist/hooks/useCrossmintAuth.js +37 -0
- package/dist/hooks/useCrossmintAuth.js.map +1 -0
- package/dist/hooks/useCrossmintCheckout.cjs +13 -0
- package/dist/hooks/useCrossmintCheckout.cjs.map +1 -0
- package/dist/hooks/useCrossmintCheckout.d.cts +14 -0
- package/dist/hooks/useCrossmintCheckout.d.ts +14 -0
- package/dist/hooks/useCrossmintCheckout.js +13 -0
- package/dist/hooks/useCrossmintCheckout.js.map +1 -0
- package/dist/hooks/useDeepEffect.cjs +8 -0
- package/dist/hooks/useDeepEffect.cjs.map +1 -0
- package/dist/hooks/useDeepEffect.d.cts +5 -0
- package/dist/hooks/useDeepEffect.d.ts +5 -0
- package/dist/hooks/useDeepEffect.js +8 -0
- package/dist/hooks/useDeepEffect.js.map +1 -0
- package/dist/hooks/useEnvironment.cjs +8 -0
- package/dist/hooks/useEnvironment.cjs.map +1 -0
- package/dist/hooks/useEnvironment.d.cts +5 -0
- package/dist/hooks/useEnvironment.d.ts +5 -0
- package/dist/hooks/useEnvironment.js +8 -0
- package/dist/hooks/useEnvironment.js.map +1 -0
- package/dist/hooks/useOAuthWindowListener.cjs +37 -0
- package/dist/hooks/useOAuthWindowListener.cjs.map +1 -0
- package/dist/hooks/useOAuthWindowListener.d.cts +8 -0
- package/dist/hooks/useOAuthWindowListener.d.ts +8 -0
- package/dist/hooks/useOAuthWindowListener.js +37 -0
- package/dist/hooks/useOAuthWindowListener.js.map +1 -0
- package/dist/hooks/useWallet.cjs +37 -0
- package/dist/hooks/useWallet.cjs.map +1 -0
- package/dist/hooks/useWallet.d.cts +18 -0
- package/dist/hooks/useWallet.d.ts +18 -0
- package/dist/hooks/useWallet.js +37 -0
- package/dist/hooks/useWallet.js.map +1 -0
- package/dist/icons/alert.cjs +8 -0
- package/dist/icons/alert.cjs.map +1 -0
- package/dist/icons/alert.d.cts +7 -0
- package/dist/icons/alert.d.ts +7 -0
- package/dist/icons/alert.js +8 -0
- package/dist/icons/alert.js.map +1 -0
- package/dist/icons/base64Icons.cjs +12 -0
- package/dist/icons/base64Icons.cjs.map +1 -0
- package/dist/icons/base64Icons.d.cts +5 -0
- package/dist/icons/base64Icons.d.ts +5 -0
- package/dist/icons/base64Icons.js +12 -0
- package/dist/icons/base64Icons.js.map +1 -0
- package/dist/icons/chevronRight.cjs +8 -0
- package/dist/icons/chevronRight.cjs.map +1 -0
- package/dist/icons/chevronRight.d.cts +9 -0
- package/dist/icons/chevronRight.d.ts +9 -0
- package/dist/icons/chevronRight.js +8 -0
- package/dist/icons/chevronRight.js.map +1 -0
- package/dist/icons/discord.cjs +29 -0
- package/dist/icons/discord.cjs.map +1 -0
- package/dist/icons/discord.d.cts +7 -0
- package/dist/icons/discord.d.ts +7 -0
- package/dist/icons/discord.js +29 -0
- package/dist/icons/discord.js.map +1 -0
- package/dist/icons/emailOTP.cjs +8 -0
- package/dist/icons/emailOTP.cjs.map +1 -0
- package/dist/icons/emailOTP.d.cts +9 -0
- package/dist/icons/emailOTP.d.ts +9 -0
- package/dist/icons/emailOTP.js +8 -0
- package/dist/icons/emailOTP.js.map +1 -0
- package/dist/icons/farcaster.cjs +8 -0
- package/dist/icons/farcaster.cjs.map +1 -0
- package/dist/icons/farcaster.d.cts +7 -0
- package/dist/icons/farcaster.d.ts +7 -0
- package/dist/icons/farcaster.js +8 -0
- package/dist/icons/farcaster.js.map +1 -0
- package/dist/icons/fingerprint.cjs +8 -0
- package/dist/icons/fingerprint.cjs.map +1 -0
- package/dist/icons/fingerprint.d.cts +5 -0
- package/dist/icons/fingerprint.d.ts +5 -0
- package/dist/icons/fingerprint.js +8 -0
- package/dist/icons/fingerprint.js.map +1 -0
- package/dist/icons/google.cjs +8 -0
- package/dist/icons/google.cjs.map +1 -0
- package/dist/icons/google.d.cts +7 -0
- package/dist/icons/google.d.ts +7 -0
- package/dist/icons/google.js +8 -0
- package/dist/icons/google.js.map +1 -0
- package/dist/icons/leftArrow.cjs +8 -0
- package/dist/icons/leftArrow.cjs.map +1 -0
- package/dist/icons/leftArrow.d.cts +8 -0
- package/dist/icons/leftArrow.d.ts +8 -0
- package/dist/icons/leftArrow.js +8 -0
- package/dist/icons/leftArrow.js.map +1 -0
- package/dist/icons/passkey.cjs +8 -0
- package/dist/icons/passkey.cjs.map +1 -0
- package/dist/icons/passkey.d.cts +5 -0
- package/dist/icons/passkey.d.ts +5 -0
- package/dist/icons/passkey.js +8 -0
- package/dist/icons/passkey.js.map +1 -0
- package/dist/icons/passkeyPromptLogo.cjs +8 -0
- package/dist/icons/passkeyPromptLogo.cjs.map +1 -0
- package/dist/icons/passkeyPromptLogo.d.cts +8 -0
- package/dist/icons/passkeyPromptLogo.d.ts +8 -0
- package/dist/icons/passkeyPromptLogo.js +8 -0
- package/dist/icons/passkeyPromptLogo.js.map +1 -0
- package/dist/icons/poweredByLeaf.cjs +8 -0
- package/dist/icons/poweredByLeaf.cjs.map +1 -0
- package/dist/icons/poweredByLeaf.d.cts +7 -0
- package/dist/icons/poweredByLeaf.d.ts +7 -0
- package/dist/icons/poweredByLeaf.js +8 -0
- package/dist/icons/poweredByLeaf.js.map +1 -0
- package/dist/icons/wallet.cjs +8 -0
- package/dist/icons/wallet.cjs.map +1 -0
- package/dist/icons/wallet.d.cts +9 -0
- package/dist/icons/wallet.d.ts +9 -0
- package/dist/icons/wallet.js +8 -0
- package/dist/icons/wallet.js.map +1 -0
- package/dist/icons/x.cjs +29 -0
- package/dist/icons/x.cjs.map +1 -0
- package/dist/icons/x.d.cts +7 -0
- package/dist/icons/x.d.ts +7 -0
- package/dist/icons/x.js +29 -0
- package/dist/icons/x.js.map +1 -0
- package/dist/index.cjs +131 -1
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +17 -124
- package/dist/index.d.ts +17 -124
- package/dist/index.js +131 -1
- package/dist/index.js.map +1 -0
- package/dist/providers/CrossmintAuthProvider.cjs +39 -0
- package/dist/providers/CrossmintAuthProvider.cjs.map +1 -0
- package/dist/providers/CrossmintAuthProvider.d.cts +37 -0
- package/dist/providers/CrossmintAuthProvider.d.ts +37 -0
- package/dist/providers/CrossmintAuthProvider.js +39 -0
- package/dist/providers/CrossmintAuthProvider.js.map +1 -0
- package/dist/providers/CrossmintWalletProvider.cjs +39 -0
- package/dist/providers/CrossmintWalletProvider.cjs.map +1 -0
- package/dist/providers/CrossmintWalletProvider.d.cts +30 -0
- package/dist/providers/CrossmintWalletProvider.d.ts +30 -0
- package/dist/providers/CrossmintWalletProvider.js +39 -0
- package/dist/providers/CrossmintWalletProvider.js.map +1 -0
- package/dist/providers/TwindProvider.cjs +9 -0
- package/dist/providers/TwindProvider.cjs.map +1 -0
- package/dist/providers/TwindProvider.d.cts +8 -0
- package/dist/providers/TwindProvider.d.ts +8 -0
- package/dist/providers/TwindProvider.js +9 -0
- package/dist/providers/TwindProvider.js.map +1 -0
- package/dist/providers/auth/AuthFormProvider.cjs +39 -0
- package/dist/providers/auth/AuthFormProvider.cjs.map +1 -0
- package/dist/providers/auth/AuthFormProvider.d.cts +34 -0
- package/dist/providers/auth/AuthFormProvider.d.ts +34 -0
- package/dist/providers/auth/AuthFormProvider.js +39 -0
- package/dist/providers/auth/AuthFormProvider.js.map +1 -0
- package/dist/providers/auth/FarcasterProvider.cjs +8 -0
- package/dist/providers/auth/FarcasterProvider.cjs.map +1 -0
- package/dist/providers/auth/FarcasterProvider.d.cts +9 -0
- package/dist/providers/auth/FarcasterProvider.d.ts +9 -0
- package/dist/providers/auth/FarcasterProvider.js +8 -0
- package/dist/providers/auth/FarcasterProvider.js.map +1 -0
- package/dist/providers/auth/web3/WagmiAuthProvider.cjs +8 -0
- package/dist/providers/auth/web3/WagmiAuthProvider.cjs.map +1 -0
- package/dist/providers/auth/web3/WagmiAuthProvider.d.cts +8 -0
- package/dist/providers/auth/web3/WagmiAuthProvider.d.ts +8 -0
- package/dist/providers/auth/web3/WagmiAuthProvider.js +8 -0
- package/dist/providers/auth/web3/WagmiAuthProvider.js.map +1 -0
- package/dist/providers/index.cjs +43 -0
- package/dist/providers/index.cjs.map +1 -0
- package/dist/providers/index.d.cts +8 -0
- package/dist/providers/index.d.ts +8 -0
- package/dist/providers/index.js +43 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/testUtils.cjs +8 -0
- package/dist/testUtils.cjs.map +1 -0
- package/dist/testUtils.d.cts +3 -0
- package/dist/testUtils.d.ts +3 -0
- package/dist/testUtils.js +8 -0
- package/dist/testUtils.js.map +1 -0
- package/dist/twind.config.cjs +8 -0
- package/dist/twind.config.cjs.map +1 -0
- package/dist/twind.config.d.cts +8 -0
- package/dist/twind.config.d.ts +8 -0
- package/dist/twind.config.js +8 -0
- package/dist/twind.config.js.map +1 -0
- package/dist/types/auth.cjs +1 -0
- package/dist/types/auth.cjs.map +1 -0
- package/dist/types/auth.d.cts +6 -0
- package/dist/types/auth.d.ts +6 -0
- package/dist/types/auth.js +1 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/utils/classNames.cjs +8 -0
- package/dist/utils/classNames.cjs.map +1 -0
- package/dist/utils/classNames.d.cts +11 -0
- package/dist/utils/classNames.d.ts +11 -0
- package/dist/utils/classNames.js +8 -0
- package/dist/utils/classNames.js.map +1 -0
- package/dist/utils/createCrossmintApiClient.cjs +9 -0
- package/dist/utils/createCrossmintApiClient.cjs.map +1 -0
- package/dist/utils/createCrossmintApiClient.d.cts +5 -0
- package/dist/utils/createCrossmintApiClient.d.ts +5 -0
- package/dist/utils/createCrossmintApiClient.js +9 -0
- package/dist/utils/createCrossmintApiClient.js.map +1 -0
- package/package.json +20 -14
- package/src/components/auth/AuthForm.tsx +10 -5
- package/src/components/auth/AuthFormBackButton.tsx +1 -5
- package/src/components/auth/AuthFormDialog.tsx +7 -2
- package/src/components/auth/methods/email/EmailOTPInput.tsx +13 -14
- package/src/components/auth/methods/email/EmailSignIn.tsx +15 -19
- package/src/components/auth/methods/farcaster/FarcasterSignIn.tsx +10 -14
- package/src/components/auth/methods/google/GoogleSignIn.tsx +7 -16
- package/src/components/auth/methods/web3/Web3AuthFlow.tsx +17 -0
- package/src/components/auth/methods/web3/Web3AuthWrapper.tsx +87 -0
- package/src/components/auth/methods/web3/Web3ConnectButton.tsx +62 -0
- package/src/components/auth/methods/web3/Web3Connectors.tsx +91 -0
- package/src/components/auth/methods/web3/Web3ProviderButton.tsx +38 -0
- package/src/components/auth/methods/web3/Web3SignIn.tsx +41 -0
- package/src/components/common/Dialog.tsx +10 -29
- package/src/components/common/Divider.tsx +1 -1
- package/src/components/common/InputOTP.tsx +9 -4
- package/src/components/common/PoweredByCrossmint.tsx +3 -10
- package/src/components/embed/v3/EmbeddedCheckoutV3IFrame.tsx +3 -1
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useAuth.ts +2 -2
- package/src/hooks/useCrossmint.test.tsx +4 -33
- package/src/hooks/useCrossmint.tsx +1 -12
- package/src/hooks/useCrossmintAuth.ts +12 -0
- package/src/hooks/useCrossmintCheckout.tsx +7 -5
- package/src/hooks/useOAuthWindowListener.ts +4 -10
- package/src/icons/base64Icons.ts +8 -0
- package/src/icons/chevronRight.tsx +21 -0
- package/src/icons/poweredByLeaf.tsx +81 -80
- package/src/icons/wallet.tsx +23 -0
- package/src/index.ts +0 -8
- package/src/providers/CrossmintAuthProvider.test.tsx +72 -87
- package/src/providers/CrossmintAuthProvider.tsx +83 -77
- package/src/providers/CrossmintWalletProvider.test.tsx +15 -9
- package/src/providers/TwindProvider.tsx +14 -0
- package/src/providers/auth/AuthFormProvider.test.tsx +61 -19
- package/src/providers/auth/AuthFormProvider.tsx +52 -60
- package/src/providers/auth/web3/WagmiAuthProvider.tsx +56 -0
- package/src/testUtils.ts +0 -4
- package/src/twind.config.ts +12 -5
- package/src/hooks/useAuthSignIn.ts +0 -117
- package/src/hooks/useRefreshToken.test.ts +0 -155
- package/src/hooks/useRefreshToken.ts +0 -68
- package/src/utils/authCookies.test.ts +0 -41
- package/src/utils/authCookies.ts +0 -13
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { deleteCookie } from "@/utils/authCookies";
|
|
2
1
|
import { SESSION_PREFIX, REFRESH_TOKEN_PREFIX } from "@crossmint/common-sdk-auth";
|
|
3
|
-
import { fireEvent, render } from "@testing-library/react";
|
|
2
|
+
import { fireEvent, render, waitFor } from "@testing-library/react";
|
|
4
3
|
import { type ReactNode, act } from "react";
|
|
5
|
-
import { beforeEach, describe, expect, vi } from "vitest";
|
|
4
|
+
import { beforeEach, describe, expect, vi, it, type MockInstance } from "vitest";
|
|
6
5
|
import { mock } from "vitest-mock-extended";
|
|
7
6
|
|
|
8
|
-
import {
|
|
7
|
+
import { CrossmintAuth as CrossmintAuthClient, getJWTExpiration, deleteCookie } from "@crossmint/client-sdk-auth";
|
|
9
8
|
import { type EVMSmartWallet, SmartWalletSDK } from "@crossmint/client-sdk-smart-wallet";
|
|
10
9
|
import { createCrossmint } from "@crossmint/common-sdk-base";
|
|
11
10
|
|
|
12
11
|
import { useAuth, useWallet } from "../hooks";
|
|
13
12
|
import { CrossmintProvider, useCrossmint } from "../hooks/useCrossmint";
|
|
14
|
-
import { MOCK_API_KEY
|
|
13
|
+
import { MOCK_API_KEY } from "../testUtils";
|
|
15
14
|
import { CrossmintAuthProvider, type CrossmintAuthWalletConfig } from "./CrossmintAuthProvider";
|
|
16
15
|
|
|
16
|
+
vi.mock("./auth/web3/WagmiAuthProvider", () => ({
|
|
17
|
+
WagmiAuthProvider: ({ children }: { children: ReactNode }) => <>{children}</>,
|
|
18
|
+
}));
|
|
19
|
+
|
|
17
20
|
vi.mock("@crossmint/client-sdk-smart-wallet", async () => {
|
|
18
21
|
const actual = await vi.importActual("@crossmint/client-sdk-smart-wallet");
|
|
19
22
|
return {
|
|
@@ -26,10 +29,14 @@ vi.mock("@crossmint/client-sdk-smart-wallet", async () => {
|
|
|
26
29
|
|
|
27
30
|
vi.mock("@crossmint/common-sdk-base", async () => {
|
|
28
31
|
const actual = await vi.importActual("@crossmint/common-sdk-base");
|
|
32
|
+
|
|
33
|
+
class MockCrossmintApiClient {}
|
|
34
|
+
|
|
29
35
|
return {
|
|
30
36
|
...actual,
|
|
31
37
|
createCrossmint: vi.fn(),
|
|
32
38
|
validateApiKeyAndGetCrossmintBaseUrl: vi.fn(),
|
|
39
|
+
CrossmintApiClient: MockCrossmintApiClient,
|
|
33
40
|
};
|
|
34
41
|
});
|
|
35
42
|
|
|
@@ -38,19 +45,6 @@ vi.mock("@crossmint/client-sdk-auth", async () => {
|
|
|
38
45
|
return {
|
|
39
46
|
...actual,
|
|
40
47
|
getJWTExpiration: vi.fn(),
|
|
41
|
-
CrossmintAuthService: vi.fn().mockImplementation(() => ({
|
|
42
|
-
refreshAuthMaterial: vi.fn().mockResolvedValue({
|
|
43
|
-
jwt: "new-mock-jwt",
|
|
44
|
-
refreshToken: {
|
|
45
|
-
secret: "new-mock-refresh-token",
|
|
46
|
-
expiresAt: new Date(Date.now() + 1000 * 60 * 60).toISOString(),
|
|
47
|
-
},
|
|
48
|
-
user: {
|
|
49
|
-
id: "123",
|
|
50
|
-
email: "test@test.com",
|
|
51
|
-
},
|
|
52
|
-
}),
|
|
53
|
-
})),
|
|
54
48
|
};
|
|
55
49
|
});
|
|
56
50
|
|
|
@@ -69,9 +63,9 @@ function renderAuthProvider({
|
|
|
69
63
|
}
|
|
70
64
|
|
|
71
65
|
function TestComponent() {
|
|
72
|
-
const { setJwt
|
|
66
|
+
const { setJwt } = useCrossmint();
|
|
73
67
|
const { wallet, status: walletStatus, error } = useWallet();
|
|
74
|
-
const { status: authStatus
|
|
68
|
+
const { status: authStatus } = useAuth();
|
|
75
69
|
return (
|
|
76
70
|
<div>
|
|
77
71
|
<div data-testid="error">{error?.message ?? "No Error"}</div>
|
|
@@ -85,14 +79,6 @@ function TestComponent() {
|
|
|
85
79
|
<button data-testid="clear-jwt-button" onClick={() => setJwt(undefined)}>
|
|
86
80
|
Clear JWT
|
|
87
81
|
</button>
|
|
88
|
-
|
|
89
|
-
<div data-testid="refresh-token">{refreshToken ?? "No Refresh Token"}</div>
|
|
90
|
-
<button data-testid="set-refresh-token" onClick={() => setRefreshToken("mock-refresh-token")}>
|
|
91
|
-
Set Refresh Token
|
|
92
|
-
</button>
|
|
93
|
-
<button data-testid="clear-refresh-token-button" onClick={() => setRefreshToken(undefined)}>
|
|
94
|
-
Clear Refresh Token
|
|
95
|
-
</button>
|
|
96
82
|
</div>
|
|
97
83
|
);
|
|
98
84
|
}
|
|
@@ -101,11 +87,33 @@ describe("CrossmintAuthProvider", () => {
|
|
|
101
87
|
let mockSDK: SmartWalletSDK;
|
|
102
88
|
let mockWallet: EVMSmartWallet;
|
|
103
89
|
let embeddedWallets: CrossmintAuthWalletConfig;
|
|
104
|
-
let
|
|
90
|
+
let handleRefreshAuthMaterialSpy: MockInstance;
|
|
91
|
+
let getOAuthUrlSpy: MockInstance;
|
|
105
92
|
|
|
106
93
|
beforeEach(() => {
|
|
107
94
|
vi.resetAllMocks();
|
|
108
|
-
vi.mocked(createCrossmint).mockImplementation(
|
|
95
|
+
vi.mocked(createCrossmint).mockImplementation(
|
|
96
|
+
() =>
|
|
97
|
+
({
|
|
98
|
+
apiKey: MOCK_API_KEY,
|
|
99
|
+
}) as any
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
global.fetch = vi.fn().mockImplementation((url: string) => {
|
|
103
|
+
if (url.includes("/auth/social/")) {
|
|
104
|
+
return Promise.resolve({
|
|
105
|
+
ok: true,
|
|
106
|
+
json: () =>
|
|
107
|
+
Promise.resolve({
|
|
108
|
+
oauthUrl: "https://oauth.example.com",
|
|
109
|
+
}),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return Promise.resolve({
|
|
113
|
+
ok: true,
|
|
114
|
+
json: () => Promise.resolve({}),
|
|
115
|
+
});
|
|
116
|
+
});
|
|
109
117
|
|
|
110
118
|
mockSDK = mock<SmartWalletSDK>();
|
|
111
119
|
mockWallet = mock<EVMSmartWallet>();
|
|
@@ -122,19 +130,21 @@ describe("CrossmintAuthProvider", () => {
|
|
|
122
130
|
deleteCookie(REFRESH_TOKEN_PREFIX);
|
|
123
131
|
deleteCookie(SESSION_PREFIX);
|
|
124
132
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
handleRefreshAuthMaterialSpy = vi.spyOn(CrossmintAuthClient.prototype, "handleRefreshAuthMaterial");
|
|
134
|
+
getOAuthUrlSpy = vi.spyOn(CrossmintAuthClient.prototype, "getOAuthUrl").mockResolvedValue("mock-oauth-url");
|
|
135
|
+
// Casts as any because refreshAuthMaterial is protected
|
|
136
|
+
vi.spyOn(CrossmintAuthClient.prototype as any, "refreshAuthMaterial").mockResolvedValue(
|
|
137
|
+
Promise.resolve({
|
|
138
|
+
jwt: "mock-jwt",
|
|
139
|
+
refreshToken: { secret: "mock-refresh-token", expiresAt: 123456 },
|
|
140
|
+
user: {},
|
|
141
|
+
})
|
|
142
|
+
);
|
|
143
|
+
const mockCrossmintAuth = CrossmintAuthClient.from(createCrossmint({ apiKey: MOCK_API_KEY }));
|
|
144
|
+
vi.spyOn(CrossmintAuthClient, "from").mockReturnValue(mockCrossmintAuth);
|
|
135
145
|
});
|
|
136
146
|
|
|
137
|
-
|
|
147
|
+
it("Happy path", async () => {
|
|
138
148
|
await act(() => {
|
|
139
149
|
document.cookie = `${REFRESH_TOKEN_PREFIX}=mock-refresh-token; path=/; SameSite=Lax;`;
|
|
140
150
|
document.cookie = `${SESSION_PREFIX}=mock-jwt; path=/; SameSite=Lax;`;
|
|
@@ -147,25 +157,24 @@ describe("CrossmintAuthProvider", () => {
|
|
|
147
157
|
|
|
148
158
|
expect(getByTestId("wallet-status").textContent).toBe("in-progress");
|
|
149
159
|
expect(getByTestId("auth-status").textContent).toBe("logged-in");
|
|
150
|
-
expect(getByTestId("refresh-token").textContent).toBe("No Refresh Token");
|
|
151
160
|
expect(getByTestId("wallet").textContent).toBe("No Wallet");
|
|
152
161
|
expect(getByTestId("error").textContent).toBe("No Error");
|
|
153
162
|
|
|
154
|
-
await
|
|
163
|
+
await waitFor(() => {
|
|
155
164
|
expect(getByTestId("wallet-status").textContent).toBe("loaded");
|
|
156
165
|
expect(getByTestId("auth-status").textContent).toBe("logged-in");
|
|
157
|
-
expect(getByTestId("refresh-token").textContent).toBe("new-mock-refresh-token");
|
|
158
166
|
expect(getByTestId("wallet").textContent).toBe("Wallet Loaded");
|
|
159
167
|
expect(getByTestId("error").textContent).toBe("No Error");
|
|
160
168
|
});
|
|
161
169
|
|
|
162
|
-
expect(
|
|
170
|
+
expect(handleRefreshAuthMaterialSpy).toHaveBeenCalledOnce();
|
|
171
|
+
expect(getOAuthUrlSpy).toHaveBeenCalled();
|
|
163
172
|
expect(vi.mocked(mockSDK.getOrCreateWallet)).toHaveBeenCalledOnce();
|
|
164
173
|
});
|
|
165
174
|
|
|
166
|
-
|
|
175
|
+
it(`When "createOnLogin" is "false", wallet is not loaded`, async () => {
|
|
167
176
|
document.cookie = `${SESSION_PREFIX}=mock-jwt; path=/;SameSite=Lax;`;
|
|
168
|
-
const { getByTestId } = renderAuthProvider({
|
|
177
|
+
const { getByTestId } = await renderAuthProvider({
|
|
169
178
|
children: <TestComponent />,
|
|
170
179
|
embeddedWallets: {
|
|
171
180
|
defaultChain: "polygon",
|
|
@@ -174,7 +183,7 @@ describe("CrossmintAuthProvider", () => {
|
|
|
174
183
|
},
|
|
175
184
|
});
|
|
176
185
|
|
|
177
|
-
await
|
|
186
|
+
await waitFor(() => {
|
|
178
187
|
expect(getByTestId("wallet").textContent).toBe("No Wallet");
|
|
179
188
|
expect(getByTestId("wallet-status").textContent).toBe("not-loaded");
|
|
180
189
|
});
|
|
@@ -182,13 +191,13 @@ describe("CrossmintAuthProvider", () => {
|
|
|
182
191
|
expect(vi.mocked(mockSDK.getOrCreateWallet)).not.toHaveBeenCalled();
|
|
183
192
|
});
|
|
184
193
|
|
|
185
|
-
|
|
186
|
-
const { getByTestId } = renderAuthProvider({
|
|
194
|
+
it(`When the jwt from crossmint provider is not defined, wallet is not loaded`, async () => {
|
|
195
|
+
const { getByTestId } = await renderAuthProvider({
|
|
187
196
|
children: <TestComponent />,
|
|
188
197
|
embeddedWallets,
|
|
189
198
|
});
|
|
190
199
|
|
|
191
|
-
await
|
|
200
|
+
await waitFor(() => {
|
|
192
201
|
expect(getByTestId("wallet-status").textContent).toBe("not-loaded");
|
|
193
202
|
expect(getByTestId("auth-status").textContent).toBe("logged-out");
|
|
194
203
|
expect(getByTestId("wallet").textContent).toBe("No Wallet");
|
|
@@ -197,14 +206,14 @@ describe("CrossmintAuthProvider", () => {
|
|
|
197
206
|
expect(vi.mocked(mockSDK.getOrCreateWallet)).not.toHaveBeenCalled();
|
|
198
207
|
});
|
|
199
208
|
|
|
200
|
-
|
|
209
|
+
it("When the jwt is cleared, so is the wallet", async () => {
|
|
201
210
|
document.cookie = `${SESSION_PREFIX}=mock-jwt; path=/;SameSite=Lax;`;
|
|
202
|
-
const { getByTestId } = renderAuthProvider({
|
|
211
|
+
const { getByTestId } = await renderAuthProvider({
|
|
203
212
|
children: <TestComponent />,
|
|
204
213
|
embeddedWallets,
|
|
205
214
|
});
|
|
206
215
|
|
|
207
|
-
await
|
|
216
|
+
await waitFor(() => {
|
|
208
217
|
expect(getByTestId("wallet-status").textContent).toBe("loaded");
|
|
209
218
|
expect(getByTestId("auth-status").textContent).toBe("logged-in");
|
|
210
219
|
expect(getByTestId("wallet").textContent).toBe("Wallet Loaded");
|
|
@@ -212,7 +221,7 @@ describe("CrossmintAuthProvider", () => {
|
|
|
212
221
|
|
|
213
222
|
fireEvent.click(getByTestId("clear-jwt-button"));
|
|
214
223
|
|
|
215
|
-
await
|
|
224
|
+
await waitFor(() => {
|
|
216
225
|
expect(getByTestId("wallet-status").textContent).toBe("not-loaded");
|
|
217
226
|
expect(getByTestId("auth-status").textContent).toBe("logged-out");
|
|
218
227
|
expect(getByTestId("wallet").textContent).toBe("No Wallet");
|
|
@@ -221,68 +230,44 @@ describe("CrossmintAuthProvider", () => {
|
|
|
221
230
|
expect(vi.mocked(mockSDK.getOrCreateWallet)).toHaveBeenCalledOnce();
|
|
222
231
|
});
|
|
223
232
|
|
|
224
|
-
|
|
225
|
-
const { getByTestId } = renderAuthProvider({
|
|
233
|
+
it(`Logging in and asserting the auth status`, async () => {
|
|
234
|
+
const { getByTestId } = await renderAuthProvider({
|
|
226
235
|
children: <TestComponent />,
|
|
227
236
|
embeddedWallets,
|
|
228
237
|
});
|
|
229
238
|
|
|
230
|
-
await
|
|
239
|
+
await waitFor(() => {
|
|
231
240
|
expect(getByTestId("auth-status").textContent).toBe("logged-out");
|
|
232
241
|
});
|
|
233
242
|
|
|
234
243
|
fireEvent.click(getByTestId("jwt-input"));
|
|
235
244
|
|
|
236
|
-
await
|
|
245
|
+
await waitFor(() => {
|
|
237
246
|
expect(getByTestId("auth-status").textContent).toBe("logged-in");
|
|
238
247
|
});
|
|
239
248
|
});
|
|
240
249
|
|
|
241
|
-
|
|
242
|
-
const { getByTestId } = renderAuthProvider({
|
|
243
|
-
children: <TestComponent />,
|
|
244
|
-
embeddedWallets,
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
expect(getByTestId("refresh-token").textContent).toBe("No Refresh Token");
|
|
248
|
-
|
|
249
|
-
fireEvent.click(getByTestId("set-refresh-token"));
|
|
250
|
-
|
|
251
|
-
await waitForSettledState(() => {
|
|
252
|
-
expect(getByTestId("refresh-token").textContent).toBe("mock-refresh-token");
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
fireEvent.click(getByTestId("clear-refresh-token-button"));
|
|
256
|
-
|
|
257
|
-
await waitForSettledState(() => {
|
|
258
|
-
expect(getByTestId("refresh-token").textContent).toBe("No Refresh Token");
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
test("Logout clears both JWT and refresh token", async () => {
|
|
250
|
+
it("Logout clears JWT", async () => {
|
|
263
251
|
await act(() => {
|
|
264
252
|
document.cookie = `${REFRESH_TOKEN_PREFIX}=mock-refresh-token; path=/; SameSite=Lax;`;
|
|
265
253
|
document.cookie = `${SESSION_PREFIX}=mock-jwt; path=/; SameSite=Lax;`;
|
|
266
254
|
});
|
|
267
255
|
|
|
268
|
-
const { getByTestId } = renderAuthProvider({
|
|
256
|
+
const { getByTestId } = await renderAuthProvider({
|
|
269
257
|
children: <TestComponent />,
|
|
270
258
|
embeddedWallets,
|
|
271
259
|
});
|
|
272
260
|
|
|
273
|
-
await
|
|
261
|
+
await waitFor(() => {
|
|
274
262
|
expect(getByTestId("auth-status").textContent).toBe("logged-in");
|
|
275
|
-
expect(getByTestId("refresh-token").textContent).toBe("new-mock-refresh-token");
|
|
276
263
|
});
|
|
277
264
|
|
|
278
265
|
await act(() => {
|
|
279
266
|
fireEvent.click(getByTestId("clear-jwt-button"));
|
|
280
|
-
fireEvent.click(getByTestId("clear-refresh-token-button"));
|
|
281
267
|
});
|
|
282
268
|
|
|
283
|
-
await
|
|
269
|
+
await waitFor(() => {
|
|
284
270
|
expect(getByTestId("auth-status").textContent).toBe("logged-out");
|
|
285
|
-
expect(getByTestId("refresh-token").textContent).toBe("No Refresh Token");
|
|
286
271
|
});
|
|
287
272
|
});
|
|
288
273
|
});
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import { type ReactNode, createContext, useEffect, useState } from "react";
|
|
1
|
+
import { type ReactNode, createContext, useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { CrossmintAuth, getCookie } from "@crossmint/client-sdk-auth";
|
|
4
4
|
import type { EVMSmartWalletChain } from "@crossmint/client-sdk-smart-wallet";
|
|
5
5
|
import { type UIConfig, validateApiKeyAndGetCrossmintBaseUrl } from "@crossmint/common-sdk-base";
|
|
6
|
-
import {
|
|
7
|
-
SESSION_PREFIX,
|
|
8
|
-
REFRESH_TOKEN_PREFIX,
|
|
9
|
-
type AuthMaterialWithUser,
|
|
10
|
-
type SDKExternalUser,
|
|
11
|
-
} from "@crossmint/common-sdk-auth";
|
|
6
|
+
import { type AuthMaterialWithUser, SESSION_PREFIX, type SDKExternalUser } from "@crossmint/common-sdk-auth";
|
|
12
7
|
|
|
13
8
|
import AuthFormDialog from "../components/auth/AuthFormDialog";
|
|
14
|
-
import { useCrossmint,
|
|
9
|
+
import { useCrossmint, useWallet } from "../hooks";
|
|
15
10
|
import { CrossmintWalletProvider } from "./CrossmintWalletProvider";
|
|
16
|
-
import { deleteCookie, getCookie, setCookie } from "@/utils/authCookies";
|
|
17
11
|
import { AuthFormProvider } from "./auth/AuthFormProvider";
|
|
12
|
+
import { TwindProvider } from "./TwindProvider";
|
|
18
13
|
|
|
19
14
|
export type CrossmintAuthWalletConfig = {
|
|
20
15
|
defaultChain: EVMSmartWalletChain;
|
|
@@ -23,33 +18,40 @@ export type CrossmintAuthWalletConfig = {
|
|
|
23
18
|
showPasskeyHelpers?: boolean;
|
|
24
19
|
};
|
|
25
20
|
|
|
26
|
-
export type LoginMethod = "email" | "google" | "farcaster";
|
|
21
|
+
export type LoginMethod = "email" | "google" | "farcaster" | "web3";
|
|
27
22
|
|
|
28
23
|
export type CrossmintAuthProviderProps = {
|
|
29
24
|
embeddedWallets?: CrossmintAuthWalletConfig;
|
|
30
25
|
appearance?: UIConfig;
|
|
31
26
|
children: ReactNode;
|
|
32
27
|
loginMethods?: LoginMethod[];
|
|
28
|
+
refreshRoute?: string;
|
|
29
|
+
logoutRoute?: string;
|
|
33
30
|
};
|
|
34
31
|
|
|
35
32
|
type AuthStatus = "logged-in" | "logged-out" | "in-progress";
|
|
36
33
|
|
|
37
|
-
|
|
34
|
+
export interface AuthContextType {
|
|
35
|
+
crossmintAuth?: CrossmintAuth;
|
|
38
36
|
login: () => void;
|
|
39
37
|
logout: () => void;
|
|
40
38
|
jwt?: string;
|
|
41
|
-
refreshToken?: string;
|
|
42
39
|
user?: SDKExternalUser;
|
|
43
40
|
status: AuthStatus;
|
|
44
41
|
getUser: () => void;
|
|
45
|
-
}
|
|
42
|
+
}
|
|
46
43
|
|
|
47
|
-
|
|
44
|
+
const defaultContextValue: AuthContextType = {
|
|
45
|
+
crossmintAuth: undefined,
|
|
48
46
|
login: () => {},
|
|
49
47
|
logout: () => {},
|
|
48
|
+
jwt: undefined,
|
|
49
|
+
user: undefined,
|
|
50
50
|
status: "logged-out",
|
|
51
51
|
getUser: () => {},
|
|
52
|
-
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const AuthContext = createContext<AuthContextType>(defaultContextValue);
|
|
53
55
|
|
|
54
56
|
const defaultEmbeddedWallets: CrossmintAuthWalletConfig = {
|
|
55
57
|
defaultChain: "base-sepolia",
|
|
@@ -62,33 +64,38 @@ export function CrossmintAuthProvider({
|
|
|
62
64
|
children,
|
|
63
65
|
appearance,
|
|
64
66
|
loginMethods = ["email", "google"],
|
|
67
|
+
refreshRoute,
|
|
68
|
+
logoutRoute,
|
|
65
69
|
}: CrossmintAuthProviderProps) {
|
|
66
70
|
const [user, setUser] = useState<SDKExternalUser | undefined>(undefined);
|
|
67
|
-
const { crossmint, setJwt
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
+
const { crossmint, setJwt } = useCrossmint("CrossmintAuthProvider must be used within CrossmintProvider");
|
|
72
|
+
// Only create the CrossmintAuth instance once, even in StrictMode, as the constructor calls /refresh
|
|
73
|
+
// It can only be called once to avoid race conditions
|
|
74
|
+
const crossmintAuthRef = useRef<CrossmintAuth | null>(null);
|
|
75
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: crossmint can't be a dependency because it updates with each jwt change
|
|
76
|
+
const crossmintAuth = useMemo(() => {
|
|
77
|
+
if (!crossmintAuthRef.current) {
|
|
78
|
+
crossmintAuthRef.current = CrossmintAuth.from(crossmint, {
|
|
79
|
+
callbacks: {
|
|
80
|
+
onLogout: () => {
|
|
81
|
+
setJwt(undefined);
|
|
82
|
+
setUser(undefined);
|
|
83
|
+
},
|
|
84
|
+
onTokenRefresh: (authMaterial: AuthMaterialWithUser) => {
|
|
85
|
+
setJwt(authMaterial.jwt);
|
|
86
|
+
setUser(authMaterial.user);
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
refreshRoute,
|
|
90
|
+
logoutRoute,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return crossmintAuthRef.current;
|
|
94
|
+
}, []);
|
|
95
|
+
|
|
71
96
|
const crossmintBaseUrl = validateApiKeyAndGetCrossmintBaseUrl(crossmint.apiKey);
|
|
72
97
|
const [dialogOpen, setDialogOpen] = useState(false);
|
|
73
98
|
|
|
74
|
-
const setAuthMaterial = (authMaterial: AuthMaterialWithUser) => {
|
|
75
|
-
setCookie(SESSION_PREFIX, authMaterial.jwt);
|
|
76
|
-
setCookie(REFRESH_TOKEN_PREFIX, authMaterial.refreshToken.secret, authMaterial.refreshToken.expiresAt);
|
|
77
|
-
setJwt(authMaterial.jwt);
|
|
78
|
-
setRefreshToken(authMaterial.refreshToken.secret);
|
|
79
|
-
setUser(authMaterial.user);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const logout = () => {
|
|
83
|
-
deleteCookie(SESSION_PREFIX);
|
|
84
|
-
deleteCookie(REFRESH_TOKEN_PREFIX);
|
|
85
|
-
setJwt(undefined);
|
|
86
|
-
setRefreshToken(undefined);
|
|
87
|
-
setUser(undefined);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
useRefreshToken({ crossmintAuthService, setAuthMaterial, logout });
|
|
91
|
-
|
|
92
99
|
useEffect(() => {
|
|
93
100
|
if (crossmint.jwt == null) {
|
|
94
101
|
const jwt = getCookie(SESSION_PREFIX);
|
|
@@ -113,6 +120,10 @@ export function CrossmintAuthProvider({
|
|
|
113
120
|
setDialogOpen(true);
|
|
114
121
|
};
|
|
115
122
|
|
|
123
|
+
const logout = () => {
|
|
124
|
+
crossmintAuth.logout();
|
|
125
|
+
};
|
|
126
|
+
|
|
116
127
|
const getAuthStatus = (): AuthStatus => {
|
|
117
128
|
if (crossmint.jwt != null) {
|
|
118
129
|
return "logged-in";
|
|
@@ -123,57 +134,52 @@ export function CrossmintAuthProvider({
|
|
|
123
134
|
return "logged-out";
|
|
124
135
|
};
|
|
125
136
|
|
|
126
|
-
const fetchAuthMaterial = async (refreshToken: string): Promise<AuthMaterialWithUser> => {
|
|
127
|
-
const authMaterial = await crossmintAuthService.refreshAuthMaterial(refreshToken);
|
|
128
|
-
setAuthMaterial(authMaterial);
|
|
129
|
-
return authMaterial;
|
|
130
|
-
};
|
|
131
|
-
|
|
132
137
|
const getUser = async () => {
|
|
133
138
|
if (crossmint.jwt == null) {
|
|
134
139
|
console.log("User not logged in");
|
|
135
140
|
return;
|
|
136
141
|
}
|
|
137
142
|
|
|
138
|
-
const user = await
|
|
143
|
+
const user = await crossmintAuth.getUser();
|
|
139
144
|
setUser(user);
|
|
140
145
|
};
|
|
141
146
|
|
|
142
147
|
return (
|
|
143
|
-
<
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
<CrossmintWalletProvider
|
|
155
|
-
defaultChain={embeddedWallets.defaultChain}
|
|
156
|
-
showPasskeyHelpers={embeddedWallets.showPasskeyHelpers}
|
|
157
|
-
appearance={appearance}
|
|
148
|
+
<TwindProvider>
|
|
149
|
+
<AuthContext.Provider
|
|
150
|
+
value={{
|
|
151
|
+
crossmintAuth,
|
|
152
|
+
login,
|
|
153
|
+
logout,
|
|
154
|
+
jwt: crossmint.jwt,
|
|
155
|
+
user,
|
|
156
|
+
status: getAuthStatus(),
|
|
157
|
+
getUser,
|
|
158
|
+
}}
|
|
158
159
|
>
|
|
159
|
-
<
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
fetchAuthMaterial,
|
|
164
|
-
appearance,
|
|
165
|
-
setDialogOpen,
|
|
166
|
-
loginMethods,
|
|
167
|
-
}}
|
|
160
|
+
<CrossmintWalletProvider
|
|
161
|
+
defaultChain={embeddedWallets.defaultChain}
|
|
162
|
+
showPasskeyHelpers={embeddedWallets.showPasskeyHelpers}
|
|
163
|
+
appearance={appearance}
|
|
168
164
|
>
|
|
169
|
-
<
|
|
170
|
-
{
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
165
|
+
<AuthFormProvider
|
|
166
|
+
initialState={{
|
|
167
|
+
appearance,
|
|
168
|
+
setDialogOpen,
|
|
169
|
+
loginMethods,
|
|
170
|
+
embeddedWallets,
|
|
171
|
+
baseUrl: crossmintBaseUrl,
|
|
172
|
+
}}
|
|
173
|
+
>
|
|
174
|
+
<WalletManager embeddedWallets={embeddedWallets} accessToken={crossmint.jwt}>
|
|
175
|
+
{children}
|
|
176
|
+
</WalletManager>
|
|
177
|
+
|
|
178
|
+
<AuthFormDialog open={dialogOpen} />
|
|
179
|
+
</AuthFormProvider>
|
|
180
|
+
</CrossmintWalletProvider>
|
|
181
|
+
</AuthContext.Provider>
|
|
182
|
+
</TwindProvider>
|
|
177
183
|
);
|
|
178
184
|
}
|
|
179
185
|
|
|
@@ -8,9 +8,13 @@ import { createCrossmint } from "@crossmint/common-sdk-base";
|
|
|
8
8
|
|
|
9
9
|
import { CrossmintProvider, useCrossmint } from "../hooks/useCrossmint";
|
|
10
10
|
import { useWallet } from "../hooks/useWallet";
|
|
11
|
-
import { MOCK_API_KEY
|
|
11
|
+
import { MOCK_API_KEY } from "../testUtils";
|
|
12
12
|
import { CrossmintWalletProvider } from "./CrossmintWalletProvider";
|
|
13
13
|
|
|
14
|
+
vi.mock("./auth/web3/WagmiAuthProvider", () => ({
|
|
15
|
+
WagmiAuthProvider: ({ children }: { children: ReactNode }) => <>{children}</>,
|
|
16
|
+
}));
|
|
17
|
+
|
|
14
18
|
vi.mock("@crossmint/client-sdk-smart-wallet", async () => {
|
|
15
19
|
const actual = await vi.importActual("@crossmint/client-sdk-smart-wallet");
|
|
16
20
|
return {
|
|
@@ -76,6 +80,7 @@ describe("CrossmintWalletProvider", () => {
|
|
|
76
80
|
jwt: "mock-jwt",
|
|
77
81
|
},
|
|
78
82
|
setJwt: () => {},
|
|
83
|
+
setRefreshToken: () => {},
|
|
79
84
|
});
|
|
80
85
|
|
|
81
86
|
mockSDK = mock<SmartWalletSDK>();
|
|
@@ -85,7 +90,7 @@ describe("CrossmintWalletProvider", () => {
|
|
|
85
90
|
});
|
|
86
91
|
|
|
87
92
|
describe("getOrCreateWallet", () => {
|
|
88
|
-
|
|
93
|
+
it("happy path ", async () => {
|
|
89
94
|
const { getByTestId } = renderWalletProvider({
|
|
90
95
|
children: <TestComponent />,
|
|
91
96
|
});
|
|
@@ -100,7 +105,7 @@ describe("CrossmintWalletProvider", () => {
|
|
|
100
105
|
expect(getByTestId("error").textContent).toBe("No Error");
|
|
101
106
|
});
|
|
102
107
|
|
|
103
|
-
await
|
|
108
|
+
await waitFor(() => {
|
|
104
109
|
expect(getByTestId("status").textContent).toBe("loaded");
|
|
105
110
|
expect(getByTestId("wallet").textContent).toBe("Wallet Loaded");
|
|
106
111
|
expect(getByTestId("error").textContent).toBe("No Error");
|
|
@@ -117,6 +122,7 @@ describe("CrossmintWalletProvider", () => {
|
|
|
117
122
|
jwt: undefined,
|
|
118
123
|
},
|
|
119
124
|
setJwt: () => {},
|
|
125
|
+
setRefreshToken: () => {},
|
|
120
126
|
});
|
|
121
127
|
});
|
|
122
128
|
|
|
@@ -127,7 +133,7 @@ describe("CrossmintWalletProvider", () => {
|
|
|
127
133
|
|
|
128
134
|
fireEvent.click(getByTestId("create-wallet-button"));
|
|
129
135
|
|
|
130
|
-
await
|
|
136
|
+
await waitFor(() => {
|
|
131
137
|
expect(getByTestId("status").textContent).toBe("not-loaded");
|
|
132
138
|
expect(getByTestId("wallet").textContent).toBe("No Wallet");
|
|
133
139
|
expect(getByTestId("error").textContent).toBe("No Error");
|
|
@@ -155,7 +161,7 @@ describe("CrossmintWalletProvider", () => {
|
|
|
155
161
|
expect(getByTestId("error").textContent).toBe("No Error");
|
|
156
162
|
});
|
|
157
163
|
|
|
158
|
-
await
|
|
164
|
+
await waitFor(() => {
|
|
159
165
|
expect(getByTestId("status").textContent).toBe("loading-error");
|
|
160
166
|
expect(getByTestId("wallet").textContent).toBe("No Wallet");
|
|
161
167
|
expect(getByTestId("error").textContent).toBe("Wallet creation failed");
|
|
@@ -183,7 +189,7 @@ describe("CrossmintWalletProvider", () => {
|
|
|
183
189
|
expect(getByTestId("error").textContent).toBe("No Error");
|
|
184
190
|
});
|
|
185
191
|
|
|
186
|
-
await
|
|
192
|
+
await waitFor(() => {
|
|
187
193
|
expect(getByTestId("status").textContent).toBe("loading-error");
|
|
188
194
|
expect(getByTestId("wallet").textContent).toBe("No Wallet");
|
|
189
195
|
expect(getByTestId("error").textContent).toBe("Unknown Wallet Error: Wallet creation failed");
|
|
@@ -194,14 +200,14 @@ describe("CrossmintWalletProvider", () => {
|
|
|
194
200
|
});
|
|
195
201
|
});
|
|
196
202
|
|
|
197
|
-
|
|
203
|
+
it("clearWallet happy path", async () => {
|
|
198
204
|
const { getByTestId } = renderWalletProvider({
|
|
199
205
|
children: <TestComponent />,
|
|
200
206
|
});
|
|
201
207
|
|
|
202
208
|
fireEvent.click(getByTestId("create-wallet-button"));
|
|
203
209
|
|
|
204
|
-
await
|
|
210
|
+
await waitFor(() => {
|
|
205
211
|
expect(getByTestId("status").textContent).toBe("loaded");
|
|
206
212
|
expect(getByTestId("wallet").textContent).toBe("Wallet Loaded");
|
|
207
213
|
expect(getByTestId("error").textContent).toBe("No Error");
|
|
@@ -209,7 +215,7 @@ describe("CrossmintWalletProvider", () => {
|
|
|
209
215
|
|
|
210
216
|
fireEvent.click(getByTestId("clear-wallet-button"));
|
|
211
217
|
|
|
212
|
-
await
|
|
218
|
+
await waitFor(() => {
|
|
213
219
|
expect(getByTestId("status").textContent).toBe("not-loaded");
|
|
214
220
|
expect(getByTestId("wallet").textContent).toBe("No Wallet");
|
|
215
221
|
expect(getByTestId("error").textContent).toBe("No Error");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import twindConfig from "@/twind.config";
|
|
3
|
+
import { install } from "@twind/core";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
|
|
6
|
+
export function TwindProvider({ children }: { children: React.ReactNode }) {
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
// Initialize twind with custom configuration
|
|
9
|
+
// This sets up the CSS-in-JS styling solution for the entire application
|
|
10
|
+
install(twindConfig);
|
|
11
|
+
}, []);
|
|
12
|
+
|
|
13
|
+
return <>{children}</>;
|
|
14
|
+
}
|