@crossmint/client-sdk-react-ui 1.10.2 → 1.10.3
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-RTC2AZ6A.cjs → chunk-2EYYCX3O.cjs} +2 -2
- package/dist/{chunk-RTC2AZ6A.cjs.map → chunk-2EYYCX3O.cjs.map} +1 -1
- package/dist/{chunk-SMCUFLHP.cjs → chunk-5H7AYX72.cjs} +3 -3
- package/dist/{chunk-YO7ZZF32.js → chunk-74SNQV3K.js} +2 -2
- package/dist/{chunk-DVONA2BZ.cjs → chunk-7EGLPJKV.cjs} +3 -3
- package/dist/{chunk-67AB7TWG.cjs → chunk-GBW67Z6V.cjs} +3 -3
- package/dist/{chunk-QB4KFTCT.js → chunk-GHIVSSM5.js} +2 -2
- package/dist/{chunk-XJYLJQA5.js → chunk-GM7C5PE4.js} +4 -3
- package/dist/{chunk-XJYLJQA5.js.map → chunk-GM7C5PE4.js.map} +1 -1
- package/dist/{chunk-NX473NO2.cjs → chunk-H2WTBOQ5.cjs} +3 -3
- package/dist/{chunk-Y4UEFDMP.js → chunk-HXZYERJJ.js} +2 -2
- package/dist/{chunk-ZOHRCGGI.cjs → chunk-L5BIVHQJ.cjs} +3 -3
- package/dist/{chunk-COLJFFZF.cjs → chunk-NGWVWCWP.cjs} +3 -3
- package/dist/{chunk-MWRMO6JC.js → chunk-O4DWHB3U.js} +2 -2
- package/dist/{chunk-MWRMO6JC.js.map → chunk-O4DWHB3U.js.map} +1 -1
- package/dist/{chunk-GN7OANUR.js → chunk-R2H6H2HY.js} +2 -2
- package/dist/{chunk-6TUZ5CU7.js → chunk-WBKHUVJU.js} +2 -2
- package/dist/{chunk-MDV3M7FD.cjs → chunk-ZRXZOZZZ.cjs} +5 -4
- package/dist/chunk-ZRXZOZZZ.cjs.map +1 -0
- package/dist/{chunk-HVI7FCLP.js → chunk-ZRYD4SFA.js} +2 -2
- package/dist/components/CrossmintNFTCollectionView.cjs +3 -3
- package/dist/components/CrossmintNFTCollectionView.js +2 -2
- package/dist/components/CrossmintNFTDetail.cjs +3 -3
- package/dist/components/CrossmintNFTDetail.js +2 -2
- package/dist/components/auth/AuthForm.cjs +3 -3
- package/dist/components/auth/AuthForm.js +3 -3
- package/dist/components/auth/AuthFormDialog.cjs +3 -3
- package/dist/components/auth/AuthFormDialog.js +3 -3
- package/dist/components/auth/EmbeddedAuthForm.cjs +3 -3
- package/dist/components/auth/EmbeddedAuthForm.js +3 -3
- package/dist/components/auth/methods/email/EmailAuthFlow.cjs +3 -3
- package/dist/components/auth/methods/email/EmailAuthFlow.js +3 -3
- package/dist/components/auth/methods/email/EmailOTPInput.cjs +3 -3
- package/dist/components/auth/methods/email/EmailOTPInput.js +3 -3
- package/dist/components/auth/methods/email/EmailSignIn.cjs +3 -3
- package/dist/components/auth/methods/email/EmailSignIn.js +3 -3
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.cjs +3 -3
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.js +3 -3
- package/dist/components/auth/methods/google/GoogleSignIn.cjs +3 -3
- package/dist/components/auth/methods/google/GoogleSignIn.js +3 -3
- package/dist/components/auth/methods/web3/Web3AuthFlow.cjs +3 -3
- package/dist/components/auth/methods/web3/Web3AuthFlow.js +3 -3
- package/dist/components/auth/methods/web3/Web3AuthWrapper.cjs +3 -3
- package/dist/components/auth/methods/web3/Web3AuthWrapper.js +3 -3
- package/dist/components/auth/methods/web3/Web3Connectors.cjs +3 -3
- package/dist/components/auth/methods/web3/Web3Connectors.js +3 -3
- package/dist/components/auth/methods/web3/Web3SignIn.cjs +3 -3
- package/dist/components/auth/methods/web3/Web3SignIn.js +3 -3
- package/dist/components/common/Divider.cjs +3 -3
- package/dist/components/common/Divider.js +3 -3
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.cjs +6 -6
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +5 -5
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.cjs +5 -5
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.js +4 -4
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs +33 -8
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs.map +1 -1
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.d.cts +5 -1
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.d.ts +5 -1
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.js +35 -10
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.js.map +1 -1
- package/dist/components/embed/v3/index.cjs +6 -6
- package/dist/components/embed/v3/index.js +5 -5
- package/dist/components/hosted/CrossmintPayButton.cjs +3 -3
- package/dist/components/hosted/CrossmintPayButton.js +2 -2
- package/dist/components/hosted/index.cjs +3 -3
- package/dist/components/hosted/index.js +2 -2
- package/dist/components/index.cjs +9 -9
- package/dist/components/index.js +8 -8
- package/dist/consts/version.cjs +2 -2
- package/dist/consts/version.js +1 -1
- package/dist/hooks/index.cjs +4 -4
- package/dist/hooks/index.js +3 -3
- package/dist/hooks/useAuth.cjs +3 -3
- package/dist/hooks/useAuth.js +3 -3
- package/dist/hooks/useCrossmintAuth.cjs +3 -3
- package/dist/hooks/useCrossmintAuth.js +3 -3
- package/dist/hooks/useCrossmintCheckout.cjs +4 -4
- package/dist/hooks/useCrossmintCheckout.js +3 -3
- package/dist/hooks/useOAuthWindowListener.cjs +3 -3
- package/dist/hooks/useOAuthWindowListener.js +3 -3
- package/dist/hooks/useWallet.cjs +3 -3
- package/dist/hooks/useWallet.js +3 -3
- package/dist/index.cjs +9 -9
- package/dist/index.js +8 -8
- package/dist/providers/CrossmintAuthProvider.cjs +3 -3
- package/dist/providers/CrossmintAuthProvider.js +3 -3
- package/dist/providers/CrossmintWalletProvider.cjs +3 -3
- package/dist/providers/CrossmintWalletProvider.js +3 -3
- package/dist/providers/auth/AuthFormProvider.cjs +3 -3
- package/dist/providers/auth/AuthFormProvider.js +3 -3
- package/dist/providers/index.cjs +3 -3
- package/dist/providers/index.js +3 -3
- package/dist/utils/createCrossmintApiClient.cjs +3 -3
- package/dist/utils/createCrossmintApiClient.js +2 -2
- package/package.json +2 -2
- package/src/components/embed/v3/EmbeddedCheckoutV3IFrame.tsx +1 -0
- package/src/components/embed/v3/crypto/CryptoWalletConnectionHandler.tsx +35 -8
- package/dist/chunk-MDV3M7FD.cjs.map +0 -1
- /package/dist/{chunk-SMCUFLHP.cjs.map → chunk-5H7AYX72.cjs.map} +0 -0
- /package/dist/{chunk-YO7ZZF32.js.map → chunk-74SNQV3K.js.map} +0 -0
- /package/dist/{chunk-DVONA2BZ.cjs.map → chunk-7EGLPJKV.cjs.map} +0 -0
- /package/dist/{chunk-67AB7TWG.cjs.map → chunk-GBW67Z6V.cjs.map} +0 -0
- /package/dist/{chunk-QB4KFTCT.js.map → chunk-GHIVSSM5.js.map} +0 -0
- /package/dist/{chunk-NX473NO2.cjs.map → chunk-H2WTBOQ5.cjs.map} +0 -0
- /package/dist/{chunk-Y4UEFDMP.js.map → chunk-HXZYERJJ.js.map} +0 -0
- /package/dist/{chunk-ZOHRCGGI.cjs.map → chunk-L5BIVHQJ.cjs.map} +0 -0
- /package/dist/{chunk-COLJFFZF.cjs.map → chunk-NGWVWCWP.cjs.map} +0 -0
- /package/dist/{chunk-GN7OANUR.js.map → chunk-R2H6H2HY.js.map} +0 -0
- /package/dist/{chunk-6TUZ5CU7.js.map → chunk-WBKHUVJU.js.map} +0 -0
- /package/dist/{chunk-HVI7FCLP.js.map → chunk-ZRYD4SFA.js.map} +0 -0
|
@@ -25,11 +25,11 @@ import "../../../../chunk-I63FQCIV.js";
|
|
|
25
25
|
import "../../../../chunk-ZIHCLVCD.js";
|
|
26
26
|
import "../../../../chunk-H4F7UVPT.js";
|
|
27
27
|
import "../../../../chunk-YWVQCHQF.js";
|
|
28
|
-
import "../../../../chunk-
|
|
29
|
-
import "../../../../chunk-
|
|
28
|
+
import "../../../../chunk-WBKHUVJU.js";
|
|
29
|
+
import "../../../../chunk-R2H6H2HY.js";
|
|
30
30
|
import "../../../../chunk-3J6CUUWT.js";
|
|
31
31
|
import "../../../../chunk-AUEQQ4D3.js";
|
|
32
|
-
import "../../../../chunk-
|
|
32
|
+
import "../../../../chunk-O4DWHB3U.js";
|
|
33
33
|
import "../../../../chunk-CRTRMMJ7.js";
|
|
34
34
|
export {
|
|
35
35
|
EmailSignIn
|
|
@@ -25,11 +25,11 @@ require('../../../../chunk-URKPLEPV.cjs');
|
|
|
25
25
|
require('../../../../chunk-HPOZ6I54.cjs');
|
|
26
26
|
require('../../../../chunk-YE55IKBP.cjs');
|
|
27
27
|
require('../../../../chunk-ENCR5SUW.cjs');
|
|
28
|
-
require('../../../../chunk-
|
|
29
|
-
require('../../../../chunk-
|
|
28
|
+
require('../../../../chunk-GBW67Z6V.cjs');
|
|
29
|
+
require('../../../../chunk-NGWVWCWP.cjs');
|
|
30
30
|
require('../../../../chunk-KEKBOJCF.cjs');
|
|
31
31
|
require('../../../../chunk-A2JCJ2OV.cjs');
|
|
32
|
-
require('../../../../chunk-
|
|
32
|
+
require('../../../../chunk-2EYYCX3O.cjs');
|
|
33
33
|
require('../../../../chunk-4DAZAO6Y.cjs');
|
|
34
34
|
|
|
35
35
|
|
|
@@ -25,11 +25,11 @@ import "../../../../chunk-I63FQCIV.js";
|
|
|
25
25
|
import "../../../../chunk-ZIHCLVCD.js";
|
|
26
26
|
import "../../../../chunk-H4F7UVPT.js";
|
|
27
27
|
import "../../../../chunk-YWVQCHQF.js";
|
|
28
|
-
import "../../../../chunk-
|
|
29
|
-
import "../../../../chunk-
|
|
28
|
+
import "../../../../chunk-WBKHUVJU.js";
|
|
29
|
+
import "../../../../chunk-R2H6H2HY.js";
|
|
30
30
|
import "../../../../chunk-3J6CUUWT.js";
|
|
31
31
|
import "../../../../chunk-AUEQQ4D3.js";
|
|
32
|
-
import "../../../../chunk-
|
|
32
|
+
import "../../../../chunk-O4DWHB3U.js";
|
|
33
33
|
import "../../../../chunk-CRTRMMJ7.js";
|
|
34
34
|
export {
|
|
35
35
|
FarcasterSignIn
|
|
@@ -25,11 +25,11 @@ require('../../../../chunk-URKPLEPV.cjs');
|
|
|
25
25
|
require('../../../../chunk-HPOZ6I54.cjs');
|
|
26
26
|
require('../../../../chunk-YE55IKBP.cjs');
|
|
27
27
|
require('../../../../chunk-ENCR5SUW.cjs');
|
|
28
|
-
require('../../../../chunk-
|
|
29
|
-
require('../../../../chunk-
|
|
28
|
+
require('../../../../chunk-GBW67Z6V.cjs');
|
|
29
|
+
require('../../../../chunk-NGWVWCWP.cjs');
|
|
30
30
|
require('../../../../chunk-KEKBOJCF.cjs');
|
|
31
31
|
require('../../../../chunk-A2JCJ2OV.cjs');
|
|
32
|
-
require('../../../../chunk-
|
|
32
|
+
require('../../../../chunk-2EYYCX3O.cjs');
|
|
33
33
|
require('../../../../chunk-4DAZAO6Y.cjs');
|
|
34
34
|
|
|
35
35
|
|
|
@@ -25,11 +25,11 @@ import "../../../../chunk-I63FQCIV.js";
|
|
|
25
25
|
import "../../../../chunk-ZIHCLVCD.js";
|
|
26
26
|
import "../../../../chunk-H4F7UVPT.js";
|
|
27
27
|
import "../../../../chunk-YWVQCHQF.js";
|
|
28
|
-
import "../../../../chunk-
|
|
29
|
-
import "../../../../chunk-
|
|
28
|
+
import "../../../../chunk-WBKHUVJU.js";
|
|
29
|
+
import "../../../../chunk-R2H6H2HY.js";
|
|
30
30
|
import "../../../../chunk-3J6CUUWT.js";
|
|
31
31
|
import "../../../../chunk-AUEQQ4D3.js";
|
|
32
|
-
import "../../../../chunk-
|
|
32
|
+
import "../../../../chunk-O4DWHB3U.js";
|
|
33
33
|
import "../../../../chunk-CRTRMMJ7.js";
|
|
34
34
|
export {
|
|
35
35
|
GoogleSignIn
|
|
@@ -25,11 +25,11 @@ require('../../../../chunk-URKPLEPV.cjs');
|
|
|
25
25
|
require('../../../../chunk-HPOZ6I54.cjs');
|
|
26
26
|
require('../../../../chunk-YE55IKBP.cjs');
|
|
27
27
|
require('../../../../chunk-ENCR5SUW.cjs');
|
|
28
|
-
require('../../../../chunk-
|
|
29
|
-
require('../../../../chunk-
|
|
28
|
+
require('../../../../chunk-GBW67Z6V.cjs');
|
|
29
|
+
require('../../../../chunk-NGWVWCWP.cjs');
|
|
30
30
|
require('../../../../chunk-KEKBOJCF.cjs');
|
|
31
31
|
require('../../../../chunk-A2JCJ2OV.cjs');
|
|
32
|
-
require('../../../../chunk-
|
|
32
|
+
require('../../../../chunk-2EYYCX3O.cjs');
|
|
33
33
|
require('../../../../chunk-4DAZAO6Y.cjs');
|
|
34
34
|
|
|
35
35
|
|
|
@@ -25,11 +25,11 @@ import "../../../../chunk-I63FQCIV.js";
|
|
|
25
25
|
import "../../../../chunk-ZIHCLVCD.js";
|
|
26
26
|
import "../../../../chunk-H4F7UVPT.js";
|
|
27
27
|
import "../../../../chunk-YWVQCHQF.js";
|
|
28
|
-
import "../../../../chunk-
|
|
29
|
-
import "../../../../chunk-
|
|
28
|
+
import "../../../../chunk-WBKHUVJU.js";
|
|
29
|
+
import "../../../../chunk-R2H6H2HY.js";
|
|
30
30
|
import "../../../../chunk-3J6CUUWT.js";
|
|
31
31
|
import "../../../../chunk-AUEQQ4D3.js";
|
|
32
|
-
import "../../../../chunk-
|
|
32
|
+
import "../../../../chunk-O4DWHB3U.js";
|
|
33
33
|
import "../../../../chunk-CRTRMMJ7.js";
|
|
34
34
|
export {
|
|
35
35
|
Web3AuthFlow
|
|
@@ -25,11 +25,11 @@ require('../../../../chunk-URKPLEPV.cjs');
|
|
|
25
25
|
require('../../../../chunk-HPOZ6I54.cjs');
|
|
26
26
|
require('../../../../chunk-YE55IKBP.cjs');
|
|
27
27
|
require('../../../../chunk-ENCR5SUW.cjs');
|
|
28
|
-
require('../../../../chunk-
|
|
29
|
-
require('../../../../chunk-
|
|
28
|
+
require('../../../../chunk-GBW67Z6V.cjs');
|
|
29
|
+
require('../../../../chunk-NGWVWCWP.cjs');
|
|
30
30
|
require('../../../../chunk-KEKBOJCF.cjs');
|
|
31
31
|
require('../../../../chunk-A2JCJ2OV.cjs');
|
|
32
|
-
require('../../../../chunk-
|
|
32
|
+
require('../../../../chunk-2EYYCX3O.cjs');
|
|
33
33
|
require('../../../../chunk-4DAZAO6Y.cjs');
|
|
34
34
|
|
|
35
35
|
|
|
@@ -25,11 +25,11 @@ import "../../../../chunk-I63FQCIV.js";
|
|
|
25
25
|
import "../../../../chunk-ZIHCLVCD.js";
|
|
26
26
|
import "../../../../chunk-H4F7UVPT.js";
|
|
27
27
|
import "../../../../chunk-YWVQCHQF.js";
|
|
28
|
-
import "../../../../chunk-
|
|
29
|
-
import "../../../../chunk-
|
|
28
|
+
import "../../../../chunk-WBKHUVJU.js";
|
|
29
|
+
import "../../../../chunk-R2H6H2HY.js";
|
|
30
30
|
import "../../../../chunk-3J6CUUWT.js";
|
|
31
31
|
import "../../../../chunk-AUEQQ4D3.js";
|
|
32
|
-
import "../../../../chunk-
|
|
32
|
+
import "../../../../chunk-O4DWHB3U.js";
|
|
33
33
|
import "../../../../chunk-CRTRMMJ7.js";
|
|
34
34
|
export {
|
|
35
35
|
Web3AuthWrapper
|
|
@@ -25,11 +25,11 @@ require('../../../../chunk-URKPLEPV.cjs');
|
|
|
25
25
|
require('../../../../chunk-HPOZ6I54.cjs');
|
|
26
26
|
require('../../../../chunk-YE55IKBP.cjs');
|
|
27
27
|
require('../../../../chunk-ENCR5SUW.cjs');
|
|
28
|
-
require('../../../../chunk-
|
|
29
|
-
require('../../../../chunk-
|
|
28
|
+
require('../../../../chunk-GBW67Z6V.cjs');
|
|
29
|
+
require('../../../../chunk-NGWVWCWP.cjs');
|
|
30
30
|
require('../../../../chunk-KEKBOJCF.cjs');
|
|
31
31
|
require('../../../../chunk-A2JCJ2OV.cjs');
|
|
32
|
-
require('../../../../chunk-
|
|
32
|
+
require('../../../../chunk-2EYYCX3O.cjs');
|
|
33
33
|
require('../../../../chunk-4DAZAO6Y.cjs');
|
|
34
34
|
|
|
35
35
|
|
|
@@ -25,11 +25,11 @@ import "../../../../chunk-I63FQCIV.js";
|
|
|
25
25
|
import "../../../../chunk-ZIHCLVCD.js";
|
|
26
26
|
import "../../../../chunk-H4F7UVPT.js";
|
|
27
27
|
import "../../../../chunk-YWVQCHQF.js";
|
|
28
|
-
import "../../../../chunk-
|
|
29
|
-
import "../../../../chunk-
|
|
28
|
+
import "../../../../chunk-WBKHUVJU.js";
|
|
29
|
+
import "../../../../chunk-R2H6H2HY.js";
|
|
30
30
|
import "../../../../chunk-3J6CUUWT.js";
|
|
31
31
|
import "../../../../chunk-AUEQQ4D3.js";
|
|
32
|
-
import "../../../../chunk-
|
|
32
|
+
import "../../../../chunk-O4DWHB3U.js";
|
|
33
33
|
import "../../../../chunk-CRTRMMJ7.js";
|
|
34
34
|
export {
|
|
35
35
|
Web3Connectors
|
|
@@ -25,11 +25,11 @@ require('../../../../chunk-URKPLEPV.cjs');
|
|
|
25
25
|
require('../../../../chunk-HPOZ6I54.cjs');
|
|
26
26
|
require('../../../../chunk-YE55IKBP.cjs');
|
|
27
27
|
require('../../../../chunk-ENCR5SUW.cjs');
|
|
28
|
-
require('../../../../chunk-
|
|
29
|
-
require('../../../../chunk-
|
|
28
|
+
require('../../../../chunk-GBW67Z6V.cjs');
|
|
29
|
+
require('../../../../chunk-NGWVWCWP.cjs');
|
|
30
30
|
require('../../../../chunk-KEKBOJCF.cjs');
|
|
31
31
|
require('../../../../chunk-A2JCJ2OV.cjs');
|
|
32
|
-
require('../../../../chunk-
|
|
32
|
+
require('../../../../chunk-2EYYCX3O.cjs');
|
|
33
33
|
require('../../../../chunk-4DAZAO6Y.cjs');
|
|
34
34
|
|
|
35
35
|
|
|
@@ -25,11 +25,11 @@ import "../../../../chunk-I63FQCIV.js";
|
|
|
25
25
|
import "../../../../chunk-ZIHCLVCD.js";
|
|
26
26
|
import "../../../../chunk-H4F7UVPT.js";
|
|
27
27
|
import "../../../../chunk-YWVQCHQF.js";
|
|
28
|
-
import "../../../../chunk-
|
|
29
|
-
import "../../../../chunk-
|
|
28
|
+
import "../../../../chunk-WBKHUVJU.js";
|
|
29
|
+
import "../../../../chunk-R2H6H2HY.js";
|
|
30
30
|
import "../../../../chunk-3J6CUUWT.js";
|
|
31
31
|
import "../../../../chunk-AUEQQ4D3.js";
|
|
32
|
-
import "../../../../chunk-
|
|
32
|
+
import "../../../../chunk-O4DWHB3U.js";
|
|
33
33
|
import "../../../../chunk-CRTRMMJ7.js";
|
|
34
34
|
export {
|
|
35
35
|
Web3SignIn
|
|
@@ -25,11 +25,11 @@ require('../../chunk-URKPLEPV.cjs');
|
|
|
25
25
|
require('../../chunk-HPOZ6I54.cjs');
|
|
26
26
|
require('../../chunk-YE55IKBP.cjs');
|
|
27
27
|
require('../../chunk-ENCR5SUW.cjs');
|
|
28
|
-
require('../../chunk-
|
|
29
|
-
require('../../chunk-
|
|
28
|
+
require('../../chunk-GBW67Z6V.cjs');
|
|
29
|
+
require('../../chunk-NGWVWCWP.cjs');
|
|
30
30
|
require('../../chunk-KEKBOJCF.cjs');
|
|
31
31
|
require('../../chunk-A2JCJ2OV.cjs');
|
|
32
|
-
require('../../chunk-
|
|
32
|
+
require('../../chunk-2EYYCX3O.cjs');
|
|
33
33
|
require('../../chunk-4DAZAO6Y.cjs');
|
|
34
34
|
|
|
35
35
|
|
|
@@ -25,11 +25,11 @@ import "../../chunk-I63FQCIV.js";
|
|
|
25
25
|
import "../../chunk-ZIHCLVCD.js";
|
|
26
26
|
import "../../chunk-H4F7UVPT.js";
|
|
27
27
|
import "../../chunk-YWVQCHQF.js";
|
|
28
|
-
import "../../chunk-
|
|
29
|
-
import "../../chunk-
|
|
28
|
+
import "../../chunk-WBKHUVJU.js";
|
|
29
|
+
import "../../chunk-R2H6H2HY.js";
|
|
30
30
|
import "../../chunk-3J6CUUWT.js";
|
|
31
31
|
import "../../chunk-AUEQQ4D3.js";
|
|
32
|
-
import "../../chunk-
|
|
32
|
+
import "../../chunk-O4DWHB3U.js";
|
|
33
33
|
import "../../chunk-CRTRMMJ7.js";
|
|
34
34
|
export {
|
|
35
35
|
Divider
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../../chunk-
|
|
3
|
+
var _chunkH2WTBOQ5cjs = require('../../../chunk-H2WTBOQ5.cjs');
|
|
4
|
+
require('../../../chunk-ZRXZOZZZ.cjs');
|
|
5
5
|
require('../../../chunk-FOCUIKYH.cjs');
|
|
6
6
|
require('../../../chunk-DJ32OEWG.cjs');
|
|
7
7
|
require('../../../chunk-ZCYU7QA6.cjs');
|
|
@@ -27,13 +27,13 @@ require('../../../chunk-URKPLEPV.cjs');
|
|
|
27
27
|
require('../../../chunk-HPOZ6I54.cjs');
|
|
28
28
|
require('../../../chunk-YE55IKBP.cjs');
|
|
29
29
|
require('../../../chunk-ENCR5SUW.cjs');
|
|
30
|
-
require('../../../chunk-
|
|
31
|
-
require('../../../chunk-
|
|
30
|
+
require('../../../chunk-GBW67Z6V.cjs');
|
|
31
|
+
require('../../../chunk-NGWVWCWP.cjs');
|
|
32
32
|
require('../../../chunk-KEKBOJCF.cjs');
|
|
33
33
|
require('../../../chunk-A2JCJ2OV.cjs');
|
|
34
|
-
require('../../../chunk-
|
|
34
|
+
require('../../../chunk-2EYYCX3O.cjs');
|
|
35
35
|
require('../../../chunk-4DAZAO6Y.cjs');
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
exports.CrossmintEmbeddedCheckout_Alpha =
|
|
38
|
+
exports.CrossmintEmbeddedCheckout_Alpha = _chunkH2WTBOQ5cjs.CrossmintEmbeddedCheckout_Alpha;
|
|
39
39
|
//# sourceMappingURL=CrossmintEmbeddedCheckoutV3.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CrossmintEmbeddedCheckout_Alpha
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import "../../../chunk-
|
|
3
|
+
} from "../../../chunk-GHIVSSM5.js";
|
|
4
|
+
import "../../../chunk-GM7C5PE4.js";
|
|
5
5
|
import "../../../chunk-CUODMU27.js";
|
|
6
6
|
import "../../../chunk-WK5RAFJ3.js";
|
|
7
7
|
import "../../../chunk-6DNBJVR5.js";
|
|
@@ -27,11 +27,11 @@ import "../../../chunk-I63FQCIV.js";
|
|
|
27
27
|
import "../../../chunk-ZIHCLVCD.js";
|
|
28
28
|
import "../../../chunk-H4F7UVPT.js";
|
|
29
29
|
import "../../../chunk-YWVQCHQF.js";
|
|
30
|
-
import "../../../chunk-
|
|
31
|
-
import "../../../chunk-
|
|
30
|
+
import "../../../chunk-WBKHUVJU.js";
|
|
31
|
+
import "../../../chunk-R2H6H2HY.js";
|
|
32
32
|
import "../../../chunk-3J6CUUWT.js";
|
|
33
33
|
import "../../../chunk-AUEQQ4D3.js";
|
|
34
|
-
import "../../../chunk-
|
|
34
|
+
import "../../../chunk-O4DWHB3U.js";
|
|
35
35
|
import "../../../chunk-CRTRMMJ7.js";
|
|
36
36
|
export {
|
|
37
37
|
CrossmintEmbeddedCheckout_Alpha
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkZRXZOZZZcjs = require('../../../chunk-ZRXZOZZZ.cjs');
|
|
4
4
|
require('../../../chunk-FOCUIKYH.cjs');
|
|
5
5
|
require('../../../chunk-DJ32OEWG.cjs');
|
|
6
6
|
require('../../../chunk-ZCYU7QA6.cjs');
|
|
@@ -26,13 +26,13 @@ require('../../../chunk-URKPLEPV.cjs');
|
|
|
26
26
|
require('../../../chunk-HPOZ6I54.cjs');
|
|
27
27
|
require('../../../chunk-YE55IKBP.cjs');
|
|
28
28
|
require('../../../chunk-ENCR5SUW.cjs');
|
|
29
|
-
require('../../../chunk-
|
|
30
|
-
require('../../../chunk-
|
|
29
|
+
require('../../../chunk-GBW67Z6V.cjs');
|
|
30
|
+
require('../../../chunk-NGWVWCWP.cjs');
|
|
31
31
|
require('../../../chunk-KEKBOJCF.cjs');
|
|
32
32
|
require('../../../chunk-A2JCJ2OV.cjs');
|
|
33
|
-
require('../../../chunk-
|
|
33
|
+
require('../../../chunk-2EYYCX3O.cjs');
|
|
34
34
|
require('../../../chunk-4DAZAO6Y.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
exports.EmbeddedCheckoutV3IFrame =
|
|
37
|
+
exports.EmbeddedCheckoutV3IFrame = _chunkZRXZOZZZcjs.EmbeddedCheckoutV3IFrame;
|
|
38
38
|
//# sourceMappingURL=EmbeddedCheckoutV3IFrame.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EmbeddedCheckoutV3IFrame
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-GM7C5PE4.js";
|
|
4
4
|
import "../../../chunk-CUODMU27.js";
|
|
5
5
|
import "../../../chunk-WK5RAFJ3.js";
|
|
6
6
|
import "../../../chunk-6DNBJVR5.js";
|
|
@@ -26,11 +26,11 @@ import "../../../chunk-I63FQCIV.js";
|
|
|
26
26
|
import "../../../chunk-ZIHCLVCD.js";
|
|
27
27
|
import "../../../chunk-H4F7UVPT.js";
|
|
28
28
|
import "../../../chunk-YWVQCHQF.js";
|
|
29
|
-
import "../../../chunk-
|
|
30
|
-
import "../../../chunk-
|
|
29
|
+
import "../../../chunk-WBKHUVJU.js";
|
|
30
|
+
import "../../../chunk-R2H6H2HY.js";
|
|
31
31
|
import "../../../chunk-3J6CUUWT.js";
|
|
32
32
|
import "../../../chunk-AUEQQ4D3.js";
|
|
33
|
-
import "../../../chunk-
|
|
33
|
+
import "../../../chunk-O4DWHB3U.js";
|
|
34
34
|
import "../../../chunk-CRTRMMJ7.js";
|
|
35
35
|
export {
|
|
36
36
|
EmbeddedCheckoutV3IFrame
|
|
@@ -70,19 +70,19 @@ function CryptoWalletConnectionHandler(props) {
|
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
function _CryptoWalletConnectionHandler({ iframeClient }) {
|
|
73
|
-
const
|
|
73
|
+
const [showDynamicModal, setShowDynamicModal] = _react.useState.call(void 0, false);
|
|
74
|
+
const { primaryWallet } = _sdkreactcore.useDynamicContext.call(void 0, );
|
|
74
75
|
_react.useEffect.call(void 0, () => {
|
|
75
76
|
if (iframeClient == null) {
|
|
76
77
|
return;
|
|
77
78
|
}
|
|
78
|
-
const showAuthFlowListener = iframeClient.on("crypto:connect-wallet.show", (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}));
|
|
79
|
+
const showAuthFlowListener = iframeClient.on("crypto:connect-wallet.show", ({ show }) => {
|
|
80
|
+
setShowDynamicModal(show);
|
|
81
|
+
});
|
|
82
82
|
return () => {
|
|
83
83
|
iframeClient.off(showAuthFlowListener);
|
|
84
84
|
};
|
|
85
|
-
}, [iframeClient
|
|
85
|
+
}, [iframeClient]);
|
|
86
86
|
_react.useEffect.call(void 0, () => {
|
|
87
87
|
if (iframeClient == null) {
|
|
88
88
|
return;
|
|
@@ -109,7 +109,7 @@ function _CryptoWalletConnectionHandler({ iframeClient }) {
|
|
|
109
109
|
iframeClient.off(signTransactionListener);
|
|
110
110
|
};
|
|
111
111
|
}, [iframeClient, primaryWallet]);
|
|
112
|
-
return null;
|
|
112
|
+
return showDynamicModal ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ShowDynamicModal, { setShowDynamicModal }) : null;
|
|
113
113
|
}
|
|
114
114
|
function dynamicChainToCrossmintChain(wallet) {
|
|
115
115
|
return _chunk4DAZAO6Ycjs.__async.call(void 0, this, null, function* () {
|
|
@@ -129,7 +129,32 @@ function dynamicChainToCrossmintChain(wallet) {
|
|
|
129
129
|
return chainFromChainId;
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
+
function ShowDynamicModal({ setShowDynamicModal }) {
|
|
133
|
+
const context = _react.useContext.call(void 0, _sdkreactcore.DynamicContext);
|
|
134
|
+
if (context == null) {
|
|
135
|
+
throw new Error("DynamicContext is missing");
|
|
136
|
+
}
|
|
137
|
+
const { setShowAuthFlow, handleLogOut } = context;
|
|
138
|
+
_react.useEffect.call(void 0, () => {
|
|
139
|
+
var _a;
|
|
140
|
+
(_a = document.getElementById("crossmint-focus-target")) == null ? void 0 : _a.focus();
|
|
141
|
+
(() => _chunk4DAZAO6Ycjs.__async.call(void 0, this, null, function* () {
|
|
142
|
+
yield handleLogOut();
|
|
143
|
+
setShowAuthFlow(true, {
|
|
144
|
+
clearErrors: true,
|
|
145
|
+
emitCancelAuth: true,
|
|
146
|
+
ignoreIfIsEmbeddedWidget: true,
|
|
147
|
+
initializeWalletConnect: true,
|
|
148
|
+
performMultiWalletChecks: false
|
|
149
|
+
// Important to be false in order to not require double clicking connect button
|
|
150
|
+
});
|
|
151
|
+
setShowDynamicModal(false);
|
|
152
|
+
}))();
|
|
153
|
+
}, []);
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
|
|
132
157
|
|
|
133
158
|
|
|
134
|
-
exports.CryptoWalletConnectionHandler = CryptoWalletConnectionHandler;
|
|
159
|
+
exports.CryptoWalletConnectionHandler = CryptoWalletConnectionHandler; exports.ShowDynamicModal = ShowDynamicModal;
|
|
135
160
|
//# sourceMappingURL=CryptoWalletConnectionHandler.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/embed/v3/crypto/CryptoWalletConnectionHandler.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAEA;AAAA,EAGI;AAAA,OACG;AACP,SAAS,gCAAgC;AACzC,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/embed/v3/crypto/CryptoWalletConnectionHandler.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAEA;AAAA,EAGI;AAAA,OACG;AACP,SAAS,gCAAgC;AACzC,SAAS,gBAAgB,yB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GAA+D;AAClH,QAAM,UAAU,WAAW,cAAc;AACzC,MAAI,WAAW,MAAM;AACjB,UAAM,IAAI,MAAM,2BAA2B;AAAA,EAC/C;AACA,QAAM,EAAE,iBAAiB,aAAa,IAAI;AAE1C,YAAU,MAAM;AAlJpB;AAoJQ,mBAAS,eAAe,wBAAwB,MAAhD,mBAAmD;AAEnD,KAAC,MAAY;AACT,YAAM,aAAa;AACnB,sBAAgB,MAAM;AAAA,QAClB,aAAa;AAAA,QACb,gBAAgB;AAAA,QAChB,0BAA0B;AAAA,QAC1B,yBAAyB;AAAA,QACzB,0BAA0B;AAAA;AAAA,MAC9B,CAAC;AACD,0BAAoB,KAAK;AAAA,IAC7B,IAAG;AAAA,EACP,GAAG,CAAC,CAAC;AAEL,SAAO;AACX","sourcesContent":["import DynamicContextProviderWrapper from \"@/components/dynamic-xyz/DynamicContextProviderWrapper\";\nimport type { EmbeddedCheckoutV3IFrameEmitter } from \"@crossmint/client-sdk-base\";\nimport {\n type APIKeyEnvironmentPrefix,\n type BlockchainIncludingTestnet,\n chainIdToBlockchain,\n} from \"@crossmint/common-sdk-base\";\nimport { EthereumWalletConnectors } from \"@dynamic-labs/ethereum\";\nimport { DynamicContext, useDynamicContext, type HandleConnectedWallet } from \"@dynamic-labs/sdk-react-core\";\nimport { SolanaWalletConnectors } from \"@dynamic-labs/solana\";\nimport { type Dispatch, type SetStateAction, useContext, useEffect, useState } from \"react\";\nimport { handleSendTransaction } from \"./utils/handleSendTransaction\";\n\nexport function CryptoWalletConnectionHandler(props: {\n iframeClient: EmbeddedCheckoutV3IFrameEmitter | null;\n apiKeyEnvironment: APIKeyEnvironmentPrefix;\n}) {\n const { iframeClient, apiKeyEnvironment } = props;\n\n return (\n <DynamicContextProviderWrapper\n apiKeyEnvironment={apiKeyEnvironment}\n settings={{\n walletConnectors: [EthereumWalletConnectors, SolanaWalletConnectors],\n events: {\n onAuthFlowCancel() {\n console.log(\"[CryptoWalletConnectionHandler] onAuthFlowCancel\");\n iframeClient?.send(\"crypto:connect-wallet.failed\", {\n error: \"cancelled\",\n });\n },\n onAuthFlowClose() {\n console.log(\"[CryptoWalletConnectionHandler] onAuthFlowClose\");\n },\n onAuthFailure(data, reason) {\n console.error(\"[CryptoWalletConnectionHandler] onAuthFailure\", data, reason);\n },\n onAuthSuccess(data) {\n console.log(\"[CryptoWalletConnectionHandler] onAuthSuccess\", data);\n },\n },\n handlers: {\n handleConnectedWallet: async (wallet) => {\n console.log(\"[CryptoWalletConnectionHandler] handleConnectedWallet\", wallet);\n\n const address = wallet.address;\n if (!address) {\n console.error(\"[CryptoWalletConnectionHandler] handleConnectedWallet: address is missing\");\n iframeClient?.send(\"crypto:connect-wallet.failed\", {\n error: \"address is missing\",\n });\n return false;\n }\n\n const chain = await dynamicChainToCrossmintChain(wallet);\n\n iframeClient?.send(\"crypto:connect-wallet.success\", {\n address,\n chain,\n walletProviderKey: wallet.connector?.key,\n });\n\n return true;\n },\n },\n }}\n >\n <_CryptoWalletConnectionHandler {...props} />\n </DynamicContextProviderWrapper>\n );\n}\n\nfunction _CryptoWalletConnectionHandler({ iframeClient }: Parameters<typeof CryptoWalletConnectionHandler>[0]) {\n const [showDynamicModal, setShowDynamicModal] = useState(false);\n const { primaryWallet } = useDynamicContext();\n\n useEffect(() => {\n if (iframeClient == null) {\n return;\n }\n const showAuthFlowListener = iframeClient.on(\"crypto:connect-wallet.show\", ({ show }) => {\n setShowDynamicModal(show);\n });\n\n return () => {\n iframeClient.off(showAuthFlowListener);\n };\n }, [iframeClient]);\n\n useEffect(() => {\n if (iframeClient == null) {\n return;\n }\n const signTransactionListener = iframeClient.on(\n \"crypto:send-transaction\",\n async ({ chain, serializedTransaction }) => {\n if (primaryWallet == null) {\n console.error(\"[CryptoWalletConnectionHandler] signTransaction: primaryWallet is missing\");\n iframeClient.send(\"crypto:send-transaction:failed\", {\n error: \"primaryWallet is missing\",\n });\n return;\n }\n\n await handleSendTransaction(\n primaryWallet,\n chain as BlockchainIncludingTestnet,\n serializedTransaction,\n iframeClient\n );\n }\n );\n\n return () => {\n iframeClient.off(signTransactionListener);\n };\n }, [iframeClient, primaryWallet]);\n\n return showDynamicModal ? <ShowDynamicModal setShowDynamicModal={setShowDynamicModal} /> : null;\n}\n\nasync function dynamicChainToCrossmintChain(\n wallet: Parameters<HandleConnectedWallet>[0]\n): Promise<BlockchainIncludingTestnet> {\n const chain = wallet.chain;\n if (chain === \"SOL\") {\n return \"solana\";\n }\n const chainId = await wallet.connector?.getNetwork();\n if (typeof chainId !== \"number\") {\n throw new Error(\"chainId is not a number\");\n }\n const chainFromChainId = chainIdToBlockchain(chainId);\n if (!chainFromChainId) {\n throw new Error(`ChainId ${chainId} is not supported`);\n }\n return chainFromChainId as BlockchainIncludingTestnet;\n}\n\nexport function ShowDynamicModal({ setShowDynamicModal }: { setShowDynamicModal: Dispatch<SetStateAction<boolean>> }) {\n const context = useContext(DynamicContext);\n if (context == null) {\n throw new Error(\"DynamicContext is missing\");\n }\n const { setShowAuthFlow, handleLogOut } = context;\n\n useEffect(() => {\n // Move focus from the iframe to the main page, otherwise the modal will require a double click to interact with it\n document.getElementById(\"crossmint-focus-target\")?.focus();\n\n (async () => {\n await handleLogOut();\n setShowAuthFlow(true, {\n clearErrors: true,\n emitCancelAuth: true,\n ignoreIfIsEmbeddedWidget: true,\n initializeWalletConnect: true,\n performMultiWalletChecks: false, // Important to be false in order to not require double clicking connect button\n });\n setShowDynamicModal(false);\n })();\n }, []);\n\n return null;\n}\n"]}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { EmbeddedCheckoutV3IFrameEmitter } from '@crossmint/client-sdk-base';
|
|
3
3
|
import { APIKeyEnvironmentPrefix } from '@crossmint/common-sdk-base';
|
|
4
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
4
5
|
|
|
5
6
|
declare function CryptoWalletConnectionHandler(props: {
|
|
6
7
|
iframeClient: EmbeddedCheckoutV3IFrameEmitter | null;
|
|
7
8
|
apiKeyEnvironment: APIKeyEnvironmentPrefix;
|
|
8
9
|
}): react_jsx_runtime.JSX.Element;
|
|
10
|
+
declare function ShowDynamicModal({ setShowDynamicModal }: {
|
|
11
|
+
setShowDynamicModal: Dispatch<SetStateAction<boolean>>;
|
|
12
|
+
}): null;
|
|
9
13
|
|
|
10
|
-
export { CryptoWalletConnectionHandler };
|
|
14
|
+
export { CryptoWalletConnectionHandler, ShowDynamicModal };
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { EmbeddedCheckoutV3IFrameEmitter } from '@crossmint/client-sdk-base';
|
|
3
3
|
import { APIKeyEnvironmentPrefix } from '@crossmint/common-sdk-base';
|
|
4
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
4
5
|
|
|
5
6
|
declare function CryptoWalletConnectionHandler(props: {
|
|
6
7
|
iframeClient: EmbeddedCheckoutV3IFrameEmitter | null;
|
|
7
8
|
apiKeyEnvironment: APIKeyEnvironmentPrefix;
|
|
8
9
|
}): react_jsx_runtime.JSX.Element;
|
|
10
|
+
declare function ShowDynamicModal({ setShowDynamicModal }: {
|
|
11
|
+
setShowDynamicModal: Dispatch<SetStateAction<boolean>>;
|
|
12
|
+
}): null;
|
|
9
13
|
|
|
10
|
-
export { CryptoWalletConnectionHandler };
|
|
14
|
+
export { CryptoWalletConnectionHandler, ShowDynamicModal };
|
|
@@ -14,9 +14,9 @@ import {
|
|
|
14
14
|
chainIdToBlockchain
|
|
15
15
|
} from "@crossmint/common-sdk-base";
|
|
16
16
|
import { EthereumWalletConnectors } from "@dynamic-labs/ethereum";
|
|
17
|
-
import { useDynamicContext } from "@dynamic-labs/sdk-react-core";
|
|
17
|
+
import { DynamicContext, useDynamicContext } from "@dynamic-labs/sdk-react-core";
|
|
18
18
|
import { SolanaWalletConnectors } from "@dynamic-labs/solana";
|
|
19
|
-
import { useEffect } from "react";
|
|
19
|
+
import { useContext, useEffect, useState } from "react";
|
|
20
20
|
import { jsx } from "react/jsx-runtime";
|
|
21
21
|
function CryptoWalletConnectionHandler(props) {
|
|
22
22
|
const { iframeClient, apiKeyEnvironment } = props;
|
|
@@ -70,19 +70,19 @@ function CryptoWalletConnectionHandler(props) {
|
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
function _CryptoWalletConnectionHandler({ iframeClient }) {
|
|
73
|
-
const
|
|
73
|
+
const [showDynamicModal, setShowDynamicModal] = useState(false);
|
|
74
|
+
const { primaryWallet } = useDynamicContext();
|
|
74
75
|
useEffect(() => {
|
|
75
76
|
if (iframeClient == null) {
|
|
76
77
|
return;
|
|
77
78
|
}
|
|
78
|
-
const showAuthFlowListener = iframeClient.on("crypto:connect-wallet.show", (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}));
|
|
79
|
+
const showAuthFlowListener = iframeClient.on("crypto:connect-wallet.show", ({ show }) => {
|
|
80
|
+
setShowDynamicModal(show);
|
|
81
|
+
});
|
|
82
82
|
return () => {
|
|
83
83
|
iframeClient.off(showAuthFlowListener);
|
|
84
84
|
};
|
|
85
|
-
}, [iframeClient
|
|
85
|
+
}, [iframeClient]);
|
|
86
86
|
useEffect(() => {
|
|
87
87
|
if (iframeClient == null) {
|
|
88
88
|
return;
|
|
@@ -109,7 +109,7 @@ function _CryptoWalletConnectionHandler({ iframeClient }) {
|
|
|
109
109
|
iframeClient.off(signTransactionListener);
|
|
110
110
|
};
|
|
111
111
|
}, [iframeClient, primaryWallet]);
|
|
112
|
-
return null;
|
|
112
|
+
return showDynamicModal ? /* @__PURE__ */ jsx(ShowDynamicModal, { setShowDynamicModal }) : null;
|
|
113
113
|
}
|
|
114
114
|
function dynamicChainToCrossmintChain(wallet) {
|
|
115
115
|
return __async(this, null, function* () {
|
|
@@ -129,7 +129,32 @@ function dynamicChainToCrossmintChain(wallet) {
|
|
|
129
129
|
return chainFromChainId;
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
+
function ShowDynamicModal({ setShowDynamicModal }) {
|
|
133
|
+
const context = useContext(DynamicContext);
|
|
134
|
+
if (context == null) {
|
|
135
|
+
throw new Error("DynamicContext is missing");
|
|
136
|
+
}
|
|
137
|
+
const { setShowAuthFlow, handleLogOut } = context;
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
var _a;
|
|
140
|
+
(_a = document.getElementById("crossmint-focus-target")) == null ? void 0 : _a.focus();
|
|
141
|
+
(() => __async(this, null, function* () {
|
|
142
|
+
yield handleLogOut();
|
|
143
|
+
setShowAuthFlow(true, {
|
|
144
|
+
clearErrors: true,
|
|
145
|
+
emitCancelAuth: true,
|
|
146
|
+
ignoreIfIsEmbeddedWidget: true,
|
|
147
|
+
initializeWalletConnect: true,
|
|
148
|
+
performMultiWalletChecks: false
|
|
149
|
+
// Important to be false in order to not require double clicking connect button
|
|
150
|
+
});
|
|
151
|
+
setShowDynamicModal(false);
|
|
152
|
+
}))();
|
|
153
|
+
}, []);
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
132
156
|
export {
|
|
133
|
-
CryptoWalletConnectionHandler
|
|
157
|
+
CryptoWalletConnectionHandler,
|
|
158
|
+
ShowDynamicModal
|
|
134
159
|
};
|
|
135
160
|
//# sourceMappingURL=CryptoWalletConnectionHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/embed/v3/crypto/CryptoWalletConnectionHandler.tsx"],"sourcesContent":["import DynamicContextProviderWrapper from \"@/components/dynamic-xyz/DynamicContextProviderWrapper\";\nimport type { EmbeddedCheckoutV3IFrameEmitter } from \"@crossmint/client-sdk-base\";\nimport {\n type APIKeyEnvironmentPrefix,\n type BlockchainIncludingTestnet,\n chainIdToBlockchain,\n} from \"@crossmint/common-sdk-base\";\nimport { EthereumWalletConnectors } from \"@dynamic-labs/ethereum\";\nimport { type HandleConnectedWallet
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/embed/v3/crypto/CryptoWalletConnectionHandler.tsx"],"sourcesContent":["import DynamicContextProviderWrapper from \"@/components/dynamic-xyz/DynamicContextProviderWrapper\";\nimport type { EmbeddedCheckoutV3IFrameEmitter } from \"@crossmint/client-sdk-base\";\nimport {\n type APIKeyEnvironmentPrefix,\n type BlockchainIncludingTestnet,\n chainIdToBlockchain,\n} from \"@crossmint/common-sdk-base\";\nimport { EthereumWalletConnectors } from \"@dynamic-labs/ethereum\";\nimport { DynamicContext, useDynamicContext, type HandleConnectedWallet } from \"@dynamic-labs/sdk-react-core\";\nimport { SolanaWalletConnectors } from \"@dynamic-labs/solana\";\nimport { type Dispatch, type SetStateAction, useContext, useEffect, useState } from \"react\";\nimport { handleSendTransaction } from \"./utils/handleSendTransaction\";\n\nexport function CryptoWalletConnectionHandler(props: {\n iframeClient: EmbeddedCheckoutV3IFrameEmitter | null;\n apiKeyEnvironment: APIKeyEnvironmentPrefix;\n}) {\n const { iframeClient, apiKeyEnvironment } = props;\n\n return (\n <DynamicContextProviderWrapper\n apiKeyEnvironment={apiKeyEnvironment}\n settings={{\n walletConnectors: [EthereumWalletConnectors, SolanaWalletConnectors],\n events: {\n onAuthFlowCancel() {\n console.log(\"[CryptoWalletConnectionHandler] onAuthFlowCancel\");\n iframeClient?.send(\"crypto:connect-wallet.failed\", {\n error: \"cancelled\",\n });\n },\n onAuthFlowClose() {\n console.log(\"[CryptoWalletConnectionHandler] onAuthFlowClose\");\n },\n onAuthFailure(data, reason) {\n console.error(\"[CryptoWalletConnectionHandler] onAuthFailure\", data, reason);\n },\n onAuthSuccess(data) {\n console.log(\"[CryptoWalletConnectionHandler] onAuthSuccess\", data);\n },\n },\n handlers: {\n handleConnectedWallet: async (wallet) => {\n console.log(\"[CryptoWalletConnectionHandler] handleConnectedWallet\", wallet);\n\n const address = wallet.address;\n if (!address) {\n console.error(\"[CryptoWalletConnectionHandler] handleConnectedWallet: address is missing\");\n iframeClient?.send(\"crypto:connect-wallet.failed\", {\n error: \"address is missing\",\n });\n return false;\n }\n\n const chain = await dynamicChainToCrossmintChain(wallet);\n\n iframeClient?.send(\"crypto:connect-wallet.success\", {\n address,\n chain,\n walletProviderKey: wallet.connector?.key,\n });\n\n return true;\n },\n },\n }}\n >\n <_CryptoWalletConnectionHandler {...props} />\n </DynamicContextProviderWrapper>\n );\n}\n\nfunction _CryptoWalletConnectionHandler({ iframeClient }: Parameters<typeof CryptoWalletConnectionHandler>[0]) {\n const [showDynamicModal, setShowDynamicModal] = useState(false);\n const { primaryWallet } = useDynamicContext();\n\n useEffect(() => {\n if (iframeClient == null) {\n return;\n }\n const showAuthFlowListener = iframeClient.on(\"crypto:connect-wallet.show\", ({ show }) => {\n setShowDynamicModal(show);\n });\n\n return () => {\n iframeClient.off(showAuthFlowListener);\n };\n }, [iframeClient]);\n\n useEffect(() => {\n if (iframeClient == null) {\n return;\n }\n const signTransactionListener = iframeClient.on(\n \"crypto:send-transaction\",\n async ({ chain, serializedTransaction }) => {\n if (primaryWallet == null) {\n console.error(\"[CryptoWalletConnectionHandler] signTransaction: primaryWallet is missing\");\n iframeClient.send(\"crypto:send-transaction:failed\", {\n error: \"primaryWallet is missing\",\n });\n return;\n }\n\n await handleSendTransaction(\n primaryWallet,\n chain as BlockchainIncludingTestnet,\n serializedTransaction,\n iframeClient\n );\n }\n );\n\n return () => {\n iframeClient.off(signTransactionListener);\n };\n }, [iframeClient, primaryWallet]);\n\n return showDynamicModal ? <ShowDynamicModal setShowDynamicModal={setShowDynamicModal} /> : null;\n}\n\nasync function dynamicChainToCrossmintChain(\n wallet: Parameters<HandleConnectedWallet>[0]\n): Promise<BlockchainIncludingTestnet> {\n const chain = wallet.chain;\n if (chain === \"SOL\") {\n return \"solana\";\n }\n const chainId = await wallet.connector?.getNetwork();\n if (typeof chainId !== \"number\") {\n throw new Error(\"chainId is not a number\");\n }\n const chainFromChainId = chainIdToBlockchain(chainId);\n if (!chainFromChainId) {\n throw new Error(`ChainId ${chainId} is not supported`);\n }\n return chainFromChainId as BlockchainIncludingTestnet;\n}\n\nexport function ShowDynamicModal({ setShowDynamicModal }: { setShowDynamicModal: Dispatch<SetStateAction<boolean>> }) {\n const context = useContext(DynamicContext);\n if (context == null) {\n throw new Error(\"DynamicContext is missing\");\n }\n const { setShowAuthFlow, handleLogOut } = context;\n\n useEffect(() => {\n // Move focus from the iframe to the main page, otherwise the modal will require a double click to interact with it\n document.getElementById(\"crossmint-focus-target\")?.focus();\n\n (async () => {\n await handleLogOut();\n setShowAuthFlow(true, {\n clearErrors: true,\n emitCancelAuth: true,\n ignoreIfIsEmbeddedWidget: true,\n initializeWalletConnect: true,\n performMultiWalletChecks: false, // Important to be false in order to not require double clicking connect button\n });\n setShowDynamicModal(false);\n })();\n }, []);\n\n return null;\n}\n"],"mappings":";;;;;;;;;;;;AAEA;AAAA,EAGI;AAAA,OACG;AACP,SAAS,gCAAgC;AACzC,SAAS,gBAAgB,yBAAqD;AAC9E,SAAS,8BAA8B;AACvC,SAA6C,YAAY,WAAW,gBAAgB;AAyDxE;AAtDL,SAAS,8BAA8B,OAG3C;AACC,QAAM,EAAE,cAAc,kBAAkB,IAAI;AAE5C,SACI;AAAA,IAAC;AAAA;AAAA,MACG;AAAA,MACA,UAAU;AAAA,QACN,kBAAkB,CAAC,0BAA0B,sBAAsB;AAAA,QACnE,QAAQ;AAAA,UACJ,mBAAmB;AACf,oBAAQ,IAAI,kDAAkD;AAC9D,yDAAc,KAAK,gCAAgC;AAAA,cAC/C,OAAO;AAAA,YACX;AAAA,UACJ;AAAA,UACA,kBAAkB;AACd,oBAAQ,IAAI,iDAAiD;AAAA,UACjE;AAAA,UACA,cAAc,MAAM,QAAQ;AACxB,oBAAQ,MAAM,iDAAiD,MAAM,MAAM;AAAA,UAC/E;AAAA,UACA,cAAc,MAAM;AAChB,oBAAQ,IAAI,iDAAiD,IAAI;AAAA,UACrE;AAAA,QACJ;AAAA,QACA,UAAU;AAAA,UACN,uBAAuB,CAAO,WAAW;AA1C7D;AA2CwB,oBAAQ,IAAI,yDAAyD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