@crossmint/client-sdk-react-ui 1.10.4 → 1.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-CY2PXN5Y.cjs → chunk-3D7QOJVP.cjs} +3 -3
- package/dist/{chunk-6PCSAKDU.js → chunk-3LEJNXQ7.js} +2 -2
- package/dist/{chunk-6PCSAKDU.js.map → chunk-3LEJNXQ7.js.map} +1 -1
- package/dist/{chunk-KHZQYMF7.js → chunk-3SZJ67OS.js} +2 -2
- package/dist/chunk-54YISYPC.js +31 -0
- package/dist/chunk-54YISYPC.js.map +1 -0
- package/dist/{chunk-6NPGETRZ.cjs → chunk-5GHTVW5Q.cjs} +3 -3
- package/dist/chunk-6CPZDD6Y.js +29 -0
- package/dist/chunk-6CPZDD6Y.js.map +1 -0
- package/dist/{chunk-U5EONMPH.js → chunk-6FG6NL44.js} +4 -4
- package/dist/{chunk-X3RNS2B7.js → chunk-6RXJMBVF.js} +2 -2
- package/dist/{chunk-HQG5G5PG.js → chunk-B7RB7HT4.js} +2 -2
- package/dist/{chunk-EBMORHG3.cjs → chunk-C7VFXQ2G.cjs} +17 -252
- package/dist/chunk-C7VFXQ2G.cjs.map +1 -0
- package/dist/{chunk-EFT2TZG5.js → chunk-D2OKRE2Q.js} +2 -2
- package/dist/{chunk-FLWOWTHQ.cjs → chunk-DKAVLLP6.cjs} +3 -3
- package/dist/chunk-I2JDM7WL.cjs +81 -0
- package/dist/chunk-I2JDM7WL.cjs.map +1 -0
- package/dist/{chunk-NKOG6FTK.js → chunk-I7CLJXJR.js} +2 -2
- package/dist/chunk-KB5JOTFH.js +81 -0
- package/dist/chunk-KB5JOTFH.js.map +1 -0
- package/dist/chunk-LGY5FQOZ.cjs +29 -0
- package/dist/chunk-LGY5FQOZ.cjs.map +1 -0
- package/dist/{chunk-ITCHCRGX.cjs → chunk-MPRVUXM6.cjs} +2 -2
- package/dist/{chunk-ITCHCRGX.cjs.map → chunk-MPRVUXM6.cjs.map} +1 -1
- package/dist/{chunk-G526QBKQ.cjs → chunk-N4SZG3S7.cjs} +3 -3
- package/dist/{chunk-Q4BSNZSI.js → chunk-PEKX75WN.js} +2 -2
- package/dist/{chunk-T5WAVOPI.js → chunk-QTTQHZ7M.js} +55 -290
- package/dist/chunk-QTTQHZ7M.js.map +1 -0
- package/dist/chunk-RJZBV7LG.js +64 -0
- package/dist/chunk-RJZBV7LG.js.map +1 -0
- package/dist/chunk-RO53MWJE.cjs +31 -0
- package/dist/chunk-RO53MWJE.cjs.map +1 -0
- package/dist/{chunk-KAXBBO66.cjs → chunk-SBTNHVSD.cjs} +3 -3
- package/dist/{chunk-AQELE4DZ.cjs → chunk-TM3K5JAV.cjs} +3 -3
- package/dist/{chunk-RYB3MSFQ.cjs → chunk-UAA5ZXHF.cjs} +3 -3
- package/dist/{chunk-TK2JDIUN.cjs → chunk-UIJHPGDV.cjs} +3 -3
- package/dist/chunk-VD456OB7.cjs +64 -0
- package/dist/chunk-VD456OB7.cjs.map +1 -0
- package/dist/{chunk-KSDNMTQD.js → chunk-WLHVMKYD.js} +2 -2
- package/dist/{chunk-4DICVJSP.cjs → chunk-WPTTXLNL.cjs} +3 -3
- package/dist/{chunk-KCGRRFIF.js → chunk-WV5WYSUU.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 +5 -11
- package/dist/components/auth/AuthForm.js +4 -10
- package/dist/components/auth/AuthFormBackButton.cjs +5 -11
- package/dist/components/auth/AuthFormBackButton.js +4 -10
- package/dist/components/auth/AuthFormDialog.cjs +5 -11
- package/dist/components/auth/AuthFormDialog.js +4 -10
- package/dist/components/auth/EmbeddedAuthForm.cjs +6 -12
- package/dist/components/auth/EmbeddedAuthForm.js +5 -11
- package/dist/components/auth/methods/email/EmailAuthFlow.cjs +5 -11
- package/dist/components/auth/methods/email/EmailAuthFlow.js +4 -10
- package/dist/components/auth/methods/email/EmailOTPInput.cjs +5 -11
- package/dist/components/auth/methods/email/EmailOTPInput.js +4 -10
- package/dist/components/auth/methods/email/EmailSignIn.cjs +5 -11
- package/dist/components/auth/methods/email/EmailSignIn.js +4 -10
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.cjs +5 -11
- package/dist/components/auth/methods/farcaster/FarcasterSignIn.js +4 -10
- package/dist/components/auth/methods/google/GoogleSignIn.cjs +5 -11
- package/dist/components/auth/methods/google/GoogleSignIn.js +4 -10
- package/dist/components/auth/methods/web3/Web3AuthFlow.cjs +43 -12
- package/dist/components/auth/methods/web3/Web3AuthFlow.cjs.map +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlow.d.cts +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlow.d.ts +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlow.js +43 -12
- package/dist/components/auth/methods/web3/Web3AuthFlow.js.map +1 -1
- package/dist/components/auth/methods/web3/Web3AuthFlowButton.cjs +8 -11
- package/dist/components/auth/methods/web3/Web3AuthFlowButton.js +7 -10
- package/dist/components/auth/methods/web3/Web3Connector.cjs +58 -4
- package/dist/components/auth/methods/web3/Web3Connector.cjs.map +1 -1
- package/dist/components/auth/methods/web3/Web3Connector.js +58 -4
- package/dist/components/auth/methods/web3/Web3Connector.js.map +1 -1
- package/dist/components/auth/methods/web3/Web3ConnectorButton.cjs +48 -4
- package/dist/components/auth/methods/web3/Web3ConnectorButton.cjs.map +1 -1
- package/dist/components/auth/methods/web3/Web3ConnectorButton.js +48 -4
- package/dist/components/auth/methods/web3/Web3ConnectorButton.js.map +1 -1
- package/dist/components/auth/methods/web3/Web3Connectors.cjs +6 -11
- package/dist/components/auth/methods/web3/Web3Connectors.js +5 -10
- package/dist/components/common/Divider.cjs +5 -11
- package/dist/components/common/Divider.js +4 -10
- package/dist/components/embed/index.cjs +4 -4
- package/dist/components/embed/index.js +3 -3
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.cjs +7 -13
- package/dist/components/embed/v3/CrossmintEmbeddedCheckoutV3.js +6 -12
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.cjs +6 -12
- package/dist/components/embed/v3/EmbeddedCheckoutV3IFrame.js +5 -11
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs +4 -22
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.cjs.map +1 -1
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.js +3 -21
- package/dist/components/embed/v3/crypto/CryptoWalletConnectionHandler.js.map +1 -1
- package/dist/components/embed/v3/index.cjs +7 -13
- package/dist/components/embed/v3/index.js +6 -12
- 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 +15 -21
- package/dist/components/index.js +14 -20
- package/dist/consts/version.cjs +2 -2
- package/dist/consts/version.js +1 -1
- package/dist/hooks/index.cjs +5 -11
- package/dist/hooks/index.js +4 -10
- package/dist/hooks/useAuth.cjs +5 -11
- package/dist/hooks/useAuth.js +4 -10
- package/dist/hooks/useCrossmintAuth.cjs +5 -11
- package/dist/hooks/useCrossmintAuth.js +4 -10
- package/dist/hooks/useCrossmintCheckout.cjs +4 -4
- package/dist/hooks/useCrossmintCheckout.js +3 -3
- package/dist/hooks/useOAuthWindowListener.cjs +5 -11
- package/dist/hooks/useOAuthWindowListener.js +4 -10
- package/dist/hooks/useWallet.cjs +5 -11
- package/dist/hooks/useWallet.js +4 -10
- package/dist/icons/base64Icons.cjs +6 -6
- package/dist/icons/base64Icons.cjs.map +1 -1
- package/dist/icons/base64Icons.js +5 -5
- package/dist/icons/base64Icons.js.map +1 -1
- package/dist/index.cjs +15 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -20
- package/dist/index.js.map +1 -1
- package/dist/providers/CrossmintAuthProvider.cjs +5 -11
- package/dist/providers/CrossmintAuthProvider.js +4 -10
- package/dist/providers/CrossmintWalletProvider.cjs +5 -11
- package/dist/providers/CrossmintWalletProvider.js +4 -10
- package/dist/providers/auth/AuthFormProvider.cjs +5 -11
- package/dist/providers/auth/AuthFormProvider.js +4 -10
- package/dist/providers/auth/web3/DynamicWeb3WalletConnect.cjs +33 -0
- package/dist/providers/auth/web3/DynamicWeb3WalletConnect.d.cts +10 -0
- package/dist/providers/auth/web3/DynamicWeb3WalletConnect.d.ts +10 -0
- package/dist/providers/auth/web3/DynamicWeb3WalletConnect.js +33 -0
- package/dist/providers/index.cjs +5 -11
- package/dist/providers/index.js +4 -10
- package/dist/utils/createCrossmintApiClient.cjs +3 -3
- package/dist/utils/createCrossmintApiClient.js +2 -2
- package/dist/utils/dynamic/dynamicChainToCrossmintChain.cjs +8 -0
- package/dist/utils/dynamic/dynamicChainToCrossmintChain.d.cts +6 -0
- package/dist/utils/dynamic/dynamicChainToCrossmintChain.d.ts +6 -0
- package/dist/utils/dynamic/dynamicChainToCrossmintChain.js +8 -0
- package/package.json +5 -8
- package/src/components/auth/AuthForm.tsx +9 -2
- package/src/components/auth/methods/web3/Web3AuthFlow.tsx +18 -0
- package/src/components/auth/methods/web3/Web3Connectors.tsx +5 -72
- package/src/components/embed/v3/crypto/CryptoWalletConnectionHandler.tsx +3 -24
- package/src/providers/CrossmintAuthProvider.test.tsx +0 -4
- package/src/providers/CrossmintWalletProvider.test.tsx +0 -6
- package/src/providers/auth/AuthFormProvider.test.tsx +0 -5
- package/src/providers/auth/AuthFormProvider.tsx +1 -6
- package/src/providers/auth/web3/DynamicWeb3WalletConnect.tsx +73 -0
- package/src/utils/dynamic/dynamicChainToCrossmintChain.ts +20 -0
- package/dist/chunk-5S4VO6RB.cjs +0 -55
- package/dist/chunk-5S4VO6RB.cjs.map +0 -1
- package/dist/chunk-EBMORHG3.cjs.map +0 -1
- package/dist/chunk-HSLAH2PN.cjs +0 -54
- package/dist/chunk-HSLAH2PN.cjs.map +0 -1
- package/dist/chunk-NFWMF6T7.js +0 -54
- package/dist/chunk-NFWMF6T7.js.map +0 -1
- package/dist/chunk-OZS4WEKF.js +0 -55
- package/dist/chunk-OZS4WEKF.js.map +0 -1
- package/dist/chunk-Q3UM7UCM.cjs +0 -64
- package/dist/chunk-Q3UM7UCM.cjs.map +0 -1
- package/dist/chunk-QFQWKKVU.js +0 -11
- package/dist/chunk-QFQWKKVU.js.map +0 -1
- package/dist/chunk-QK5J7FD3.cjs +0 -11
- package/dist/chunk-QK5J7FD3.cjs.map +0 -1
- package/dist/chunk-T5WAVOPI.js.map +0 -1
- package/dist/chunk-ZSWTJ6E7.js +0 -64
- package/dist/chunk-ZSWTJ6E7.js.map +0 -1
- package/dist/components/auth/methods/web3/Web3ConnectorContainer.cjs +0 -36
- package/dist/components/auth/methods/web3/Web3ConnectorContainer.d.cts +0 -10
- package/dist/components/auth/methods/web3/Web3ConnectorContainer.d.ts +0 -10
- package/dist/components/auth/methods/web3/Web3ConnectorContainer.js +0 -36
- package/dist/providers/auth/web3/WagmiAuthProvider.cjs +0 -8
- package/dist/providers/auth/web3/WagmiAuthProvider.d.cts +0 -8
- package/dist/providers/auth/web3/WagmiAuthProvider.d.ts +0 -8
- package/dist/providers/auth/web3/WagmiAuthProvider.js +0 -8
- package/src/components/auth/methods/web3/Web3ConnectorContainer.tsx +0 -87
- package/src/providers/auth/web3/WagmiAuthProvider.tsx +0 -56
- /package/dist/{chunk-CY2PXN5Y.cjs.map → chunk-3D7QOJVP.cjs.map} +0 -0
- /package/dist/{chunk-KHZQYMF7.js.map → chunk-3SZJ67OS.js.map} +0 -0
- /package/dist/{chunk-6NPGETRZ.cjs.map → chunk-5GHTVW5Q.cjs.map} +0 -0
- /package/dist/{chunk-U5EONMPH.js.map → chunk-6FG6NL44.js.map} +0 -0
- /package/dist/{chunk-X3RNS2B7.js.map → chunk-6RXJMBVF.js.map} +0 -0
- /package/dist/{chunk-HQG5G5PG.js.map → chunk-B7RB7HT4.js.map} +0 -0
- /package/dist/{chunk-EFT2TZG5.js.map → chunk-D2OKRE2Q.js.map} +0 -0
- /package/dist/{chunk-FLWOWTHQ.cjs.map → chunk-DKAVLLP6.cjs.map} +0 -0
- /package/dist/{chunk-NKOG6FTK.js.map → chunk-I7CLJXJR.js.map} +0 -0
- /package/dist/{chunk-G526QBKQ.cjs.map → chunk-N4SZG3S7.cjs.map} +0 -0
- /package/dist/{chunk-Q4BSNZSI.js.map → chunk-PEKX75WN.js.map} +0 -0
- /package/dist/{chunk-KAXBBO66.cjs.map → chunk-SBTNHVSD.cjs.map} +0 -0
- /package/dist/{chunk-AQELE4DZ.cjs.map → chunk-TM3K5JAV.cjs.map} +0 -0
- /package/dist/{chunk-RYB3MSFQ.cjs.map → chunk-UAA5ZXHF.cjs.map} +0 -0
- /package/dist/{chunk-TK2JDIUN.cjs.map → chunk-UIJHPGDV.cjs.map} +0 -0
- /package/dist/{chunk-KSDNMTQD.js.map → chunk-WLHVMKYD.js.map} +0 -0
- /package/dist/{chunk-4DICVJSP.cjs.map → chunk-WPTTXLNL.cjs.map} +0 -0
- /package/dist/{chunk-KCGRRFIF.js.map → chunk-WV5WYSUU.js.map} +0 -0
- /package/dist/{components/auth/methods/web3/Web3ConnectorContainer.cjs.map → providers/auth/web3/DynamicWeb3WalletConnect.cjs.map} +0 -0
- /package/dist/{components/auth/methods/web3/Web3ConnectorContainer.js.map → providers/auth/web3/DynamicWeb3WalletConnect.js.map} +0 -0
- /package/dist/{providers/auth/web3/WagmiAuthProvider.cjs.map → utils/dynamic/dynamicChainToCrossmintChain.cjs.map} +0 -0
- /package/dist/{providers/auth/web3/WagmiAuthProvider.js.map → utils/dynamic/dynamicChainToCrossmintChain.js.map} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DynamicWeb3WalletConnect
|
|
3
|
+
} from "../../../chunk-KB5JOTFH.js";
|
|
4
|
+
import "../../../chunk-6CPZDD6Y.js";
|
|
5
|
+
import "../../../chunk-RZT2J42J.js";
|
|
6
|
+
import "../../../chunk-QTTQHZ7M.js";
|
|
7
|
+
import "../../../chunk-A7J4DAE7.js";
|
|
8
|
+
import "../../../chunk-XEZF7G64.js";
|
|
9
|
+
import "../../../chunk-NMXFWIFA.js";
|
|
10
|
+
import "../../../chunk-33WZFL2D.js";
|
|
11
|
+
import "../../../chunk-FKIMKZ4Y.js";
|
|
12
|
+
import "../../../chunk-QTL5I5C2.js";
|
|
13
|
+
import "../../../chunk-HATQVB6H.js";
|
|
14
|
+
import "../../../chunk-RZPQIRIY.js";
|
|
15
|
+
import "../../../chunk-ZDQGQY7Z.js";
|
|
16
|
+
import "../../../chunk-IQPA3QOV.js";
|
|
17
|
+
import "../../../chunk-CPYPI45H.js";
|
|
18
|
+
import "../../../chunk-DZ5MGN25.js";
|
|
19
|
+
import "../../../chunk-7KIY6DLW.js";
|
|
20
|
+
import "../../../chunk-I63FQCIV.js";
|
|
21
|
+
import "../../../chunk-ZIHCLVCD.js";
|
|
22
|
+
import "../../../chunk-H4F7UVPT.js";
|
|
23
|
+
import "../../../chunk-YWVQCHQF.js";
|
|
24
|
+
import "../../../chunk-WV5WYSUU.js";
|
|
25
|
+
import "../../../chunk-D2OKRE2Q.js";
|
|
26
|
+
import "../../../chunk-3J6CUUWT.js";
|
|
27
|
+
import "../../../chunk-AUEQQ4D3.js";
|
|
28
|
+
import "../../../chunk-3LEJNXQ7.js";
|
|
29
|
+
import "../../../chunk-CRTRMMJ7.js";
|
|
30
|
+
export {
|
|
31
|
+
DynamicWeb3WalletConnect
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=DynamicWeb3WalletConnect.js.map
|
package/dist/providers/index.cjs
CHANGED
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('../chunk-HSLAH2PN.cjs');
|
|
8
|
-
require('../chunk-Q3UM7UCM.cjs');
|
|
9
|
-
require('../chunk-5S4VO6RB.cjs');
|
|
6
|
+
var _chunkC7VFXQ2Gcjs = require('../chunk-C7VFXQ2G.cjs');
|
|
10
7
|
require('../chunk-QQXBYOKA.cjs');
|
|
11
8
|
require('../chunk-MJHLKJ6X.cjs');
|
|
12
9
|
require('../chunk-QT7UEJZG.cjs');
|
|
@@ -19,24 +16,21 @@ require('../chunk-HCW4RO2O.cjs');
|
|
|
19
16
|
require('../chunk-UASNCH3A.cjs');
|
|
20
17
|
require('../chunk-MUS7DUPS.cjs');
|
|
21
18
|
require('../chunk-IP4HQL5I.cjs');
|
|
22
|
-
require('../chunk-KNOUJZN5.cjs');
|
|
23
19
|
require('../chunk-ZMSST6ZZ.cjs');
|
|
24
|
-
require('../chunk-QK5J7FD3.cjs');
|
|
25
|
-
require('../chunk-AXZLLRBU.cjs');
|
|
26
20
|
require('../chunk-URKPLEPV.cjs');
|
|
27
21
|
require('../chunk-HPOZ6I54.cjs');
|
|
28
22
|
require('../chunk-YE55IKBP.cjs');
|
|
29
23
|
require('../chunk-ENCR5SUW.cjs');
|
|
30
|
-
require('../chunk-
|
|
31
|
-
require('../chunk-
|
|
24
|
+
require('../chunk-TM3K5JAV.cjs');
|
|
25
|
+
require('../chunk-UAA5ZXHF.cjs');
|
|
32
26
|
require('../chunk-KEKBOJCF.cjs');
|
|
33
27
|
require('../chunk-A2JCJ2OV.cjs');
|
|
34
|
-
require('../chunk-
|
|
28
|
+
require('../chunk-MPRVUXM6.cjs');
|
|
35
29
|
require('../chunk-4DAZAO6Y.cjs');
|
|
36
30
|
|
|
37
31
|
|
|
38
32
|
|
|
39
33
|
|
|
40
34
|
|
|
41
|
-
exports.AuthContext =
|
|
35
|
+
exports.AuthContext = _chunkC7VFXQ2Gcjs.AuthContext; exports.CrossmintAuthProvider = _chunkC7VFXQ2Gcjs.CrossmintAuthProvider; exports.CrossmintWalletProvider = _chunkC7VFXQ2Gcjs.CrossmintWalletProvider; exports.WalletContext = _chunkC7VFXQ2Gcjs.WalletContext;
|
|
42
36
|
//# sourceMappingURL=index.cjs.map
|
package/dist/providers/index.js
CHANGED
|
@@ -3,10 +3,7 @@ import {
|
|
|
3
3
|
CrossmintAuthProvider,
|
|
4
4
|
CrossmintWalletProvider,
|
|
5
5
|
WalletContext
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-NFWMF6T7.js";
|
|
8
|
-
import "../chunk-ZSWTJ6E7.js";
|
|
9
|
-
import "../chunk-OZS4WEKF.js";
|
|
6
|
+
} from "../chunk-QTTQHZ7M.js";
|
|
10
7
|
import "../chunk-A7J4DAE7.js";
|
|
11
8
|
import "../chunk-XEZF7G64.js";
|
|
12
9
|
import "../chunk-NMXFWIFA.js";
|
|
@@ -19,19 +16,16 @@ import "../chunk-ZDQGQY7Z.js";
|
|
|
19
16
|
import "../chunk-IQPA3QOV.js";
|
|
20
17
|
import "../chunk-CPYPI45H.js";
|
|
21
18
|
import "../chunk-DZ5MGN25.js";
|
|
22
|
-
import "../chunk-VZIXXIU5.js";
|
|
23
19
|
import "../chunk-7KIY6DLW.js";
|
|
24
|
-
import "../chunk-QFQWKKVU.js";
|
|
25
|
-
import "../chunk-3KR4GYLF.js";
|
|
26
20
|
import "../chunk-I63FQCIV.js";
|
|
27
21
|
import "../chunk-ZIHCLVCD.js";
|
|
28
22
|
import "../chunk-H4F7UVPT.js";
|
|
29
23
|
import "../chunk-YWVQCHQF.js";
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-WV5WYSUU.js";
|
|
25
|
+
import "../chunk-D2OKRE2Q.js";
|
|
32
26
|
import "../chunk-3J6CUUWT.js";
|
|
33
27
|
import "../chunk-AUEQQ4D3.js";
|
|
34
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-3LEJNXQ7.js";
|
|
35
29
|
import "../chunk-CRTRMMJ7.js";
|
|
36
30
|
export {
|
|
37
31
|
AuthContext,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var _chunkUAA5ZXHFcjs = require('../chunk-UAA5ZXHF.cjs');
|
|
4
|
+
require('../chunk-MPRVUXM6.cjs');
|
|
5
5
|
require('../chunk-4DAZAO6Y.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.createCrossmintApiClient =
|
|
8
|
+
exports.createCrossmintApiClient = _chunkUAA5ZXHFcjs.createCrossmintApiClient;
|
|
9
9
|
//# sourceMappingURL=createCrossmintApiClient.cjs.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkLGY5FQOZcjs = require('../../chunk-LGY5FQOZ.cjs');
|
|
4
|
+
require('../../chunk-4DAZAO6Y.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.dynamicChainToCrossmintChain = _chunkLGY5FQOZcjs.dynamicChainToCrossmintChain;
|
|
8
|
+
//# sourceMappingURL=dynamicChainToCrossmintChain.cjs.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BlockchainIncludingTestnet } from '@crossmint/common-sdk-base';
|
|
2
|
+
import { HandleConnectedWallet } from '@dynamic-labs/sdk-react-core';
|
|
3
|
+
|
|
4
|
+
declare function dynamicChainToCrossmintChain(wallet: Parameters<HandleConnectedWallet>[0]): Promise<BlockchainIncludingTestnet>;
|
|
5
|
+
|
|
6
|
+
export { dynamicChainToCrossmintChain };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BlockchainIncludingTestnet } from '@crossmint/common-sdk-base';
|
|
2
|
+
import { HandleConnectedWallet } from '@dynamic-labs/sdk-react-core';
|
|
3
|
+
|
|
4
|
+
declare function dynamicChainToCrossmintChain(wallet: Parameters<HandleConnectedWallet>[0]): Promise<BlockchainIncludingTestnet>;
|
|
5
|
+
|
|
6
|
+
export { dynamicChainToCrossmintChain };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crossmint/client-sdk-react-ui",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.6",
|
|
4
4
|
"repository": "https://github.com/Crossmint/crossmint-sdk",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Paella Labs Inc",
|
|
@@ -28,10 +28,8 @@
|
|
|
28
28
|
"@radix-ui/react-dialog": "1.1.2",
|
|
29
29
|
"@radix-ui/react-visually-hidden": "1.1.0",
|
|
30
30
|
"@solana/web3.js": "1.95.1",
|
|
31
|
-
"@tanstack/react-query": "5.51.18",
|
|
32
31
|
"@twind/core": "1.1.3",
|
|
33
32
|
"@twind/preset-tailwind": "1.1.4",
|
|
34
|
-
"@wagmi/connectors": "5.3.3",
|
|
35
33
|
"bs58": "5.0.0",
|
|
36
34
|
"clsx": "2.1.1",
|
|
37
35
|
"color": "4.2.3",
|
|
@@ -41,13 +39,12 @@
|
|
|
41
39
|
"tailwind-merge": "2.4.0",
|
|
42
40
|
"tailwindcss": "3.4.10",
|
|
43
41
|
"viem": "2.17.5",
|
|
44
|
-
"wagmi": "2.12.25",
|
|
45
42
|
"zod": "3.22.4",
|
|
46
|
-
"@crossmint/client-sdk-auth": "1.1.
|
|
47
|
-
"@crossmint/client-sdk-base": "1.3.
|
|
48
|
-
"@crossmint/client-sdk-smart-wallet": "0.1.
|
|
43
|
+
"@crossmint/client-sdk-auth": "1.1.2",
|
|
44
|
+
"@crossmint/client-sdk-base": "1.3.3",
|
|
45
|
+
"@crossmint/client-sdk-smart-wallet": "0.1.23",
|
|
49
46
|
"@crossmint/client-sdk-window": "0.1.0",
|
|
50
|
-
"@crossmint/common-sdk-auth": "1.0.
|
|
47
|
+
"@crossmint/common-sdk-auth": "1.0.2",
|
|
51
48
|
"@crossmint/common-sdk-base": "0.3.0"
|
|
52
49
|
},
|
|
53
50
|
"devDependencies": {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { lazy } from "react";
|
|
2
|
+
import Color from "color";
|
|
1
3
|
import { useAuthForm } from "@/providers/auth/AuthFormProvider";
|
|
2
4
|
import { EmailAuthFlow } from "./methods/email/EmailAuthFlow";
|
|
3
5
|
import { Divider } from "../common/Divider";
|
|
@@ -6,10 +8,15 @@ import { FarcasterSignIn } from "./methods/farcaster/FarcasterSignIn";
|
|
|
6
8
|
import { PoweredByCrossmint } from "../common/PoweredByCrossmint";
|
|
7
9
|
import { FarcasterProvider } from "../../providers/auth/FarcasterProvider";
|
|
8
10
|
import { classNames } from "@/utils/classNames";
|
|
9
|
-
import { Web3AuthFlow } from "./methods/web3/Web3AuthFlow";
|
|
10
|
-
import Color from "color";
|
|
11
11
|
import { AlertIcon } from "@/icons/alert";
|
|
12
12
|
|
|
13
|
+
const Web3AuthFlow = lazy(() =>
|
|
14
|
+
// @ts-expect-error - Error because we dont use 'module' field in tsconfig, which is expected because we use tsup to compile
|
|
15
|
+
import("./methods/web3/Web3AuthFlow").then((mod) => ({
|
|
16
|
+
default: mod.Web3AuthFlow,
|
|
17
|
+
}))
|
|
18
|
+
);
|
|
19
|
+
|
|
13
20
|
export function AuthForm({ className }: { className?: string }) {
|
|
14
21
|
const { step, appearance, loginMethods, baseUrl, error } = useAuthForm();
|
|
15
22
|
|
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
import { useAuthForm } from "@/providers/auth/AuthFormProvider";
|
|
2
2
|
import { Web3AuthFlowButton } from "./Web3AuthFlowButton";
|
|
3
3
|
import { Web3Connectors } from "./Web3Connectors";
|
|
4
|
+
import { useCrossmint } from "@/hooks";
|
|
5
|
+
import { createCrossmintApiClient } from "@/utils/createCrossmintApiClient";
|
|
6
|
+
import { DynamicWeb3WalletConnect } from "@/providers/auth/web3/DynamicWeb3WalletConnect";
|
|
4
7
|
|
|
5
8
|
export function Web3AuthFlow() {
|
|
9
|
+
const { crossmint } = useCrossmint();
|
|
10
|
+
const apiClient = createCrossmintApiClient(crossmint, {
|
|
11
|
+
usageOrigin: "client",
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<DynamicWeb3WalletConnect apiKeyEnvironment={apiClient["parsedAPIKey"].environment}>
|
|
16
|
+
<Web3AuthFlowContent />
|
|
17
|
+
</DynamicWeb3WalletConnect>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function Web3AuthFlowContent() {
|
|
6
22
|
const { step } = useAuthForm();
|
|
7
23
|
|
|
24
|
+
// Show wallet connectors when in any web3 step
|
|
8
25
|
if (step.startsWith("web3")) {
|
|
9
26
|
return <Web3Connectors />;
|
|
10
27
|
}
|
|
11
28
|
|
|
29
|
+
// Show initial connect button on first step
|
|
12
30
|
if (step === "initial") {
|
|
13
31
|
return <Web3AuthFlowButton />;
|
|
14
32
|
}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { useAuthForm } from "@/providers/auth/AuthFormProvider";
|
|
2
2
|
import { AuthFormBackButton } from "../../AuthFormBackButton";
|
|
3
|
-
import {
|
|
4
|
-
import { metamaskIcon, walletConnectIcon } from "@/icons/base64Icons";
|
|
5
|
-
import { Web3ConnectorContainer } from "./Web3ConnectorContainer";
|
|
6
|
-
import { useAccount, useDisconnect } from "wagmi";
|
|
3
|
+
import { DynamicEmbeddedWidget } from "@dynamic-labs/sdk-react-core";
|
|
7
4
|
|
|
8
5
|
export function Web3Connectors() {
|
|
9
6
|
const { appearance, step, setStep } = useAuthForm();
|
|
10
|
-
const { isConnected } = useAccount();
|
|
11
|
-
const { disconnect } = useDisconnect();
|
|
12
7
|
|
|
13
8
|
if (step === "web3") {
|
|
14
9
|
return (
|
|
@@ -18,78 +13,16 @@ export function Web3Connectors() {
|
|
|
18
13
|
iconColor={appearance?.colors?.textPrimary}
|
|
19
14
|
ringColor={appearance?.colors?.accent}
|
|
20
15
|
/>
|
|
21
|
-
<div className="flex flex-col items-center
|
|
22
|
-
<div className="text-center mb-6">
|
|
23
|
-
<h3
|
|
24
|
-
className="text-lg font-semibold text-cm-text-primary"
|
|
25
|
-
style={{ color: appearance?.colors?.textPrimary }}
|
|
26
|
-
>
|
|
27
|
-
Connect wallet
|
|
28
|
-
</h3>
|
|
29
|
-
</div>
|
|
16
|
+
<div className="flex flex-col items-center">
|
|
30
17
|
<div className="flex flex-col gap-[10px] w-full">
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
img={metamaskIcon}
|
|
35
|
-
onClick={() => {
|
|
36
|
-
if (isConnected) {
|
|
37
|
-
disconnect();
|
|
38
|
-
}
|
|
39
|
-
// wait for all disconnect state to be cleared before proceeding to the next step
|
|
40
|
-
setTimeout(() => {
|
|
41
|
-
setStep("web3/metamask");
|
|
42
|
-
}, 200);
|
|
43
|
-
}}
|
|
44
|
-
/>
|
|
45
|
-
<Web3ConnectorButton
|
|
46
|
-
title="WalletConnect"
|
|
47
|
-
appearance={appearance}
|
|
48
|
-
img={walletConnectIcon}
|
|
49
|
-
onClick={() => {
|
|
50
|
-
if (isConnected) {
|
|
51
|
-
disconnect();
|
|
52
|
-
}
|
|
53
|
-
setTimeout(() => {
|
|
54
|
-
setStep("web3/walletconnect");
|
|
55
|
-
}, 200);
|
|
56
|
-
}}
|
|
57
|
-
/>
|
|
18
|
+
<div className="widget-container">
|
|
19
|
+
<DynamicEmbeddedWidget background="none" />
|
|
20
|
+
</div>
|
|
58
21
|
</div>
|
|
59
22
|
</div>
|
|
60
23
|
</>
|
|
61
24
|
);
|
|
62
25
|
}
|
|
63
26
|
|
|
64
|
-
if (step === "web3/metamask") {
|
|
65
|
-
return (
|
|
66
|
-
<>
|
|
67
|
-
<AuthFormBackButton
|
|
68
|
-
onClick={() => {
|
|
69
|
-
setStep("web3");
|
|
70
|
-
}}
|
|
71
|
-
iconColor={appearance?.colors?.textPrimary}
|
|
72
|
-
ringColor={appearance?.colors?.accent}
|
|
73
|
-
/>
|
|
74
|
-
<Web3ConnectorContainer providerType="metaMaskSDK" flag="isMetaMask" icon={metamaskIcon} />
|
|
75
|
-
</>
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (step === "web3/walletconnect") {
|
|
80
|
-
return (
|
|
81
|
-
<>
|
|
82
|
-
<AuthFormBackButton
|
|
83
|
-
onClick={() => {
|
|
84
|
-
setStep("web3");
|
|
85
|
-
}}
|
|
86
|
-
iconColor={appearance?.colors?.textPrimary}
|
|
87
|
-
ringColor={appearance?.colors?.accent}
|
|
88
|
-
/>
|
|
89
|
-
<Web3ConnectorContainer providerType="walletConnect" icon={walletConnectIcon} />
|
|
90
|
-
</>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
27
|
return null;
|
|
95
28
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import DynamicContextProviderWrapper from "@/components/dynamic-xyz/DynamicContextProviderWrapper";
|
|
2
2
|
import type { EmbeddedCheckoutV3IFrameEmitter } from "@crossmint/client-sdk-base";
|
|
3
|
-
import {
|
|
4
|
-
type APIKeyEnvironmentPrefix,
|
|
5
|
-
type BlockchainIncludingTestnet,
|
|
6
|
-
chainIdToBlockchain,
|
|
7
|
-
} from "@crossmint/common-sdk-base";
|
|
3
|
+
import type { APIKeyEnvironmentPrefix, BlockchainIncludingTestnet } from "@crossmint/common-sdk-base";
|
|
8
4
|
import { EthereumWalletConnectors } from "@dynamic-labs/ethereum";
|
|
9
|
-
import { DynamicContext, useDynamicContext
|
|
5
|
+
import { DynamicContext, useDynamicContext } from "@dynamic-labs/sdk-react-core";
|
|
10
6
|
import { SolanaWalletConnectors } from "@dynamic-labs/solana";
|
|
11
7
|
import { type Dispatch, type SetStateAction, useContext, useEffect, useState } from "react";
|
|
12
8
|
import { handleSendTransaction } from "./utils/handleSendTransaction";
|
|
9
|
+
import { dynamicChainToCrossmintChain } from "@/utils/dynamic/dynamicChainToCrossmintChain";
|
|
13
10
|
|
|
14
11
|
export function CryptoWalletConnectionHandler(props: {
|
|
15
12
|
iframeClient: EmbeddedCheckoutV3IFrameEmitter | null;
|
|
@@ -119,24 +116,6 @@ function _CryptoWalletConnectionHandler({ iframeClient }: Parameters<typeof Cryp
|
|
|
119
116
|
return showDynamicModal ? <ShowDynamicModal setShowDynamicModal={setShowDynamicModal} /> : null;
|
|
120
117
|
}
|
|
121
118
|
|
|
122
|
-
async function dynamicChainToCrossmintChain(
|
|
123
|
-
wallet: Parameters<HandleConnectedWallet>[0]
|
|
124
|
-
): Promise<BlockchainIncludingTestnet> {
|
|
125
|
-
const chain = wallet.chain;
|
|
126
|
-
if (chain === "SOL") {
|
|
127
|
-
return "solana";
|
|
128
|
-
}
|
|
129
|
-
const chainId = await wallet.connector?.getNetwork();
|
|
130
|
-
if (typeof chainId !== "number") {
|
|
131
|
-
throw new Error("chainId is not a number");
|
|
132
|
-
}
|
|
133
|
-
const chainFromChainId = chainIdToBlockchain(chainId);
|
|
134
|
-
if (!chainFromChainId) {
|
|
135
|
-
throw new Error(`ChainId ${chainId} is not supported`);
|
|
136
|
-
}
|
|
137
|
-
return chainFromChainId as BlockchainIncludingTestnet;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
119
|
export function ShowDynamicModal({ setShowDynamicModal }: { setShowDynamicModal: Dispatch<SetStateAction<boolean>> }) {
|
|
141
120
|
const context = useContext(DynamicContext);
|
|
142
121
|
if (context == null) {
|
|
@@ -13,10 +13,6 @@ import { CrossmintProvider, useCrossmint } from "../hooks/useCrossmint";
|
|
|
13
13
|
import { MOCK_API_KEY } from "../testUtils";
|
|
14
14
|
import { CrossmintAuthProvider, type CrossmintAuthWalletConfig } from "./CrossmintAuthProvider";
|
|
15
15
|
|
|
16
|
-
vi.mock("./auth/web3/WagmiAuthProvider", () => ({
|
|
17
|
-
WagmiAuthProvider: ({ children }: { children: ReactNode }) => <>{children}</>,
|
|
18
|
-
}));
|
|
19
|
-
|
|
20
16
|
vi.mock("@crossmint/client-sdk-smart-wallet", async () => {
|
|
21
17
|
const actual = await vi.importActual("@crossmint/client-sdk-smart-wallet");
|
|
22
18
|
return {
|
|
@@ -11,10 +11,6 @@ import { useWallet } from "../hooks/useWallet";
|
|
|
11
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
|
-
|
|
18
14
|
vi.mock("@crossmint/client-sdk-smart-wallet", async () => {
|
|
19
15
|
const actual = await vi.importActual("@crossmint/client-sdk-smart-wallet");
|
|
20
16
|
return {
|
|
@@ -80,7 +76,6 @@ describe("CrossmintWalletProvider", () => {
|
|
|
80
76
|
jwt: "mock-jwt",
|
|
81
77
|
},
|
|
82
78
|
setJwt: () => {},
|
|
83
|
-
setRefreshToken: () => {},
|
|
84
79
|
});
|
|
85
80
|
|
|
86
81
|
mockSDK = mock<SmartWalletSDK>();
|
|
@@ -122,7 +117,6 @@ describe("CrossmintWalletProvider", () => {
|
|
|
122
117
|
jwt: undefined,
|
|
123
118
|
},
|
|
124
119
|
setJwt: () => {},
|
|
125
|
-
setRefreshToken: () => {},
|
|
126
120
|
});
|
|
127
121
|
});
|
|
128
122
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
1
|
import { render, fireEvent, waitFor } from "@testing-library/react";
|
|
3
2
|
import { beforeEach } from "vitest";
|
|
4
3
|
import { AuthFormProvider, useAuthForm } from "./AuthFormProvider";
|
|
@@ -6,10 +5,6 @@ import { describe, expect, it, vi } from "vitest";
|
|
|
6
5
|
import type { CrossmintAuthWalletConfig, LoginMethod } from "..";
|
|
7
6
|
import { useCrossmintAuth } from "@/hooks/useCrossmintAuth";
|
|
8
7
|
|
|
9
|
-
vi.mock("./web3/WagmiAuthProvider", () => ({
|
|
10
|
-
WagmiAuthProvider: ({ children }: { children: ReactNode }) => <>{children}</>,
|
|
11
|
-
}));
|
|
12
|
-
|
|
13
8
|
vi.mock("@/hooks/useCrossmintAuth");
|
|
14
9
|
|
|
15
10
|
// Mock component to test the AuthFormProvider
|
|
@@ -3,7 +3,6 @@ import type { OAuthProvider } from "@crossmint/common-sdk-auth";
|
|
|
3
3
|
import type { UIConfig } from "@crossmint/common-sdk-base";
|
|
4
4
|
import type { CrossmintAuthWalletConfig, LoginMethod } from "../CrossmintAuthProvider";
|
|
5
5
|
import { useCrossmintAuth } from "@/hooks/useCrossmintAuth";
|
|
6
|
-
import { WagmiAuthProvider } from "./web3/WagmiAuthProvider";
|
|
7
6
|
|
|
8
7
|
type AuthStep = "initial" | "otp" | "qrCode" | "web3" | "web3/metamask" | "web3/walletconnect";
|
|
9
8
|
|
|
@@ -106,9 +105,5 @@ export const AuthFormProvider = ({
|
|
|
106
105
|
setStep,
|
|
107
106
|
};
|
|
108
107
|
|
|
109
|
-
return
|
|
110
|
-
<AuthFormContext.Provider value={value}>
|
|
111
|
-
<WagmiAuthProvider>{children}</WagmiAuthProvider>
|
|
112
|
-
</AuthFormContext.Provider>
|
|
113
|
-
);
|
|
108
|
+
return <AuthFormContext.Provider value={value}>{children}</AuthFormContext.Provider>;
|
|
114
109
|
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import { EthereumWalletConnectors } from "@dynamic-labs/ethereum";
|
|
3
|
+
import { SolanaWalletConnectors } from "@dynamic-labs/solana";
|
|
4
|
+
import type { APIKeyEnvironmentPrefix } from "@crossmint/common-sdk-base";
|
|
5
|
+
import DynamicContextProviderWrapper from "@/components/dynamic-xyz/DynamicContextProviderWrapper";
|
|
6
|
+
import { useCrossmintAuth } from "@/hooks/useCrossmintAuth";
|
|
7
|
+
import { useAuthForm } from "../AuthFormProvider";
|
|
8
|
+
import { dynamicChainToCrossmintChain } from "@/utils/dynamic/dynamicChainToCrossmintChain";
|
|
9
|
+
|
|
10
|
+
export function DynamicWeb3WalletConnect({
|
|
11
|
+
children,
|
|
12
|
+
apiKeyEnvironment,
|
|
13
|
+
}: { children: React.ReactNode; apiKeyEnvironment: APIKeyEnvironmentPrefix }) {
|
|
14
|
+
const { crossmintAuth } = useCrossmintAuth();
|
|
15
|
+
const { appearance } = useAuthForm();
|
|
16
|
+
|
|
17
|
+
const cssOverrides = `.powered-by-dynamic { display: none !important; } .wallet-list__scroll-container { padding: 0px !important; } .wallet-list__search-container { padding-left: 0px !important; padding-right: 0px !important; } .dynamic-footer { display: none !important; } h1 { color: ${appearance?.colors?.textPrimary} !important; } * { color: ${appearance?.colors?.textSecondary} !important; }`;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<DynamicContextProviderWrapper
|
|
21
|
+
apiKeyEnvironment={apiKeyEnvironment}
|
|
22
|
+
settings={{
|
|
23
|
+
cssOverrides,
|
|
24
|
+
walletConnectors: [EthereumWalletConnectors, SolanaWalletConnectors],
|
|
25
|
+
events: {
|
|
26
|
+
onAuthFlowCancel() {
|
|
27
|
+
console.log("[CryptoWalletConnectionHandler] onAuthFlowCancel");
|
|
28
|
+
},
|
|
29
|
+
onAuthFlowClose() {
|
|
30
|
+
console.log("[CryptoWalletConnectionHandler] onAuthFlowClose");
|
|
31
|
+
},
|
|
32
|
+
onAuthFailure(data, reason) {
|
|
33
|
+
console.error("[CryptoWalletConnectionHandler] onAuthFailure", data, reason);
|
|
34
|
+
},
|
|
35
|
+
onAuthSuccess(data) {
|
|
36
|
+
console.log("[CryptoWalletConnectionHandler] onAuthSuccess", data);
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
handlers: {
|
|
40
|
+
handleConnectedWallet: async (wallet) => {
|
|
41
|
+
console.log("[CryptoWalletConnectionHandler] handleConnectedWallet", wallet);
|
|
42
|
+
|
|
43
|
+
const address = wallet.address;
|
|
44
|
+
if (!address) {
|
|
45
|
+
console.error("[CryptoWalletConnectionHandler] handleConnectedWallet: address is missing");
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const chain = await dynamicChainToCrossmintChain(wallet);
|
|
50
|
+
console.log({ chain });
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
const res = await crossmintAuth?.signInWithSmartWallet(address);
|
|
54
|
+
const signature = (await wallet.connector?.signMessage(res.challenge)) as `0x${string}`;
|
|
55
|
+
const authResponse = (await crossmintAuth?.authenticateSmartWallet(address, signature)) as {
|
|
56
|
+
oneTimeSecret: string;
|
|
57
|
+
};
|
|
58
|
+
const oneTimeSecret = authResponse.oneTimeSecret;
|
|
59
|
+
await crossmintAuth?.handleRefreshAuthMaterial(oneTimeSecret);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
console.error("[CryptoWalletConnectionHandler] Error authenticating wallet:", error);
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return true;
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
{children}
|
|
71
|
+
</DynamicContextProviderWrapper>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { chainIdToBlockchain, type BlockchainIncludingTestnet } from "@crossmint/common-sdk-base";
|
|
2
|
+
import type { HandleConnectedWallet } from "@dynamic-labs/sdk-react-core";
|
|
3
|
+
|
|
4
|
+
export async function dynamicChainToCrossmintChain(
|
|
5
|
+
wallet: Parameters<HandleConnectedWallet>[0]
|
|
6
|
+
): Promise<BlockchainIncludingTestnet> {
|
|
7
|
+
const chain = wallet.chain;
|
|
8
|
+
if (chain === "SOL") {
|
|
9
|
+
return "solana";
|
|
10
|
+
}
|
|
11
|
+
const chainId = await wallet.connector?.getNetwork();
|
|
12
|
+
if (typeof chainId !== "number") {
|
|
13
|
+
throw new Error("chainId is not a number");
|
|
14
|
+
}
|
|
15
|
+
const chainFromChainId = chainIdToBlockchain(chainId);
|
|
16
|
+
if (!chainFromChainId) {
|
|
17
|
+
throw new Error(`ChainId ${chainId} is not supported`);
|
|
18
|
+
}
|
|
19
|
+
return chainFromChainId as BlockchainIncludingTestnet;
|
|
20
|
+
}
|
package/dist/chunk-5S4VO6RB.cjs
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/providers/auth/web3/WagmiAuthProvider.tsx
|
|
2
|
-
var _wagmi = require('wagmi');
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _chains = require('wagmi/chains');
|
|
14
|
-
var _reactquery = require('@tanstack/react-query');
|
|
15
|
-
var _connectors = require('wagmi/connectors');
|
|
16
|
-
var _jsxruntime = require('react/jsx-runtime');
|
|
17
|
-
var ALCHEMY_API_KEY = "-7M6vRDBDknwvMxnqah_jbcieWg0qad9";
|
|
18
|
-
var ALCHEMY_RPC_SUBDOMAIN = {
|
|
19
|
-
mainnet: "mainnet",
|
|
20
|
-
polygon: "polygon-mainnet",
|
|
21
|
-
"polygon-amoy": "polygon-amoy",
|
|
22
|
-
base: "base-mainnet",
|
|
23
|
-
"base-sepolia": "base-sepolia",
|
|
24
|
-
optimism: "opt-mainnet",
|
|
25
|
-
"optimism-sepolia": "opt-sepolia",
|
|
26
|
-
arbitrum: "arb-mainnet",
|
|
27
|
-
"arbitrum-sepolia": "arb-sepolia"
|
|
28
|
-
};
|
|
29
|
-
function getAlchemyRPC(chain) {
|
|
30
|
-
return `https://${ALCHEMY_RPC_SUBDOMAIN[chain]}.g.alchemy.com/v2/${ALCHEMY_API_KEY}`;
|
|
31
|
-
}
|
|
32
|
-
var config = _wagmi.createConfig.call(void 0, {
|
|
33
|
-
chains: [_chains.mainnet, _chains.base, _chains.polygon, _chains.optimism, _chains.arbitrum, _chains.baseSepolia, _chains.polygonAmoy, _chains.optimismSepolia, _chains.arbitrumSepolia],
|
|
34
|
-
connectors: [_connectors.metaMask.call(void 0, ), _connectors.walletConnect.call(void 0, { projectId: "94ed8f7549329dad7be968888eec3688" })],
|
|
35
|
-
transports: {
|
|
36
|
-
[_chains.mainnet.id]: _wagmi.http.call(void 0, getAlchemyRPC("mainnet")),
|
|
37
|
-
[_chains.base.id]: _wagmi.http.call(void 0, getAlchemyRPC("base")),
|
|
38
|
-
[_chains.polygon.id]: _wagmi.http.call(void 0, getAlchemyRPC("polygon")),
|
|
39
|
-
[_chains.optimism.id]: _wagmi.http.call(void 0, getAlchemyRPC("optimism")),
|
|
40
|
-
[_chains.arbitrum.id]: _wagmi.http.call(void 0, getAlchemyRPC("arbitrum")),
|
|
41
|
-
[_chains.baseSepolia.id]: _wagmi.http.call(void 0, getAlchemyRPC("base-sepolia")),
|
|
42
|
-
[_chains.polygonAmoy.id]: _wagmi.http.call(void 0, getAlchemyRPC("polygon-amoy")),
|
|
43
|
-
[_chains.optimismSepolia.id]: _wagmi.http.call(void 0, getAlchemyRPC("optimism-sepolia")),
|
|
44
|
-
[_chains.arbitrumSepolia.id]: _wagmi.http.call(void 0, getAlchemyRPC("arbitrum-sepolia"))
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
function WagmiAuthProvider({ children }) {
|
|
48
|
-
const queryClient = new (0, _reactquery.QueryClient)();
|
|
49
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _wagmi.WagmiProvider, { config, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reactquery.QueryClientProvider, { client: queryClient, children }) });
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
exports.WagmiAuthProvider = WagmiAuthProvider;
|
|
55
|
-
//# sourceMappingURL=chunk-5S4VO6RB.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/providers/auth/web3/WagmiAuthProvider.tsx"],"names":[],"mappings":";AACA,SAAS,cAAc,MAAM,qBAAqB;AAClD;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,aAAa,2BAA2B;AACjD,SAAS,UAAU,qBAAqB;AAsC5B;AApCZ,IAAM,kBAAkB;AACxB,IAAM,wBAAwB;AAAA,EAC1B,SAAS;AAAA,EACT,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,UAAU;AAAA,EACV,oBAAoB;AACxB;AACA,SAAS,cAAc,OAAmD;AACtE,SAAO,WAAW,sBAAsB,KAAK,CAAC,qBAAqB,eAAe;AACtF;AAEA,IAAM,SAAS,aAAa;AAAA,EACxB,QAAQ,CAAC,SAAS,MAAM,SAAS,UAAU,UAAU,aAAa,aAAa,iBAAiB,eAAe;AAAA,EAC/G,YAAY,CAAC,SAAS,GAAG,cAAc,EAAE,WAAW,mCAAmC,CAAC,CAAC;AAAA,EACzF,YAAY;AAAA,IACR,CAAC,QAAQ,EAAE,GAAG,KAAK,cAAc,SAAS,CAAC;AAAA,IAC3C,CAAC,KAAK,EAAE,GAAG,KAAK,cAAc,MAAM,CAAC;AAAA,IACrC,CAAC,QAAQ,EAAE,GAAG,KAAK,cAAc,SAAS,CAAC;AAAA,IAC3C,CAAC,SAAS,EAAE,GAAG,KAAK,cAAc,UAAU,CAAC;AAAA,IAC7C,CAAC,SAAS,EAAE,GAAG,KAAK,cAAc,UAAU,CAAC;AAAA,IAC7C,CAAC,YAAY,EAAE,GAAG,KAAK,cAAc,cAAc,CAAC;AAAA,IACpD,CAAC,YAAY,EAAE,GAAG,KAAK,cAAc,cAAc,CAAC;AAAA,IACpD,CAAC,gBAAgB,EAAE,GAAG,KAAK,cAAc,kBAAkB,CAAC;AAAA,IAC5D,CAAC,gBAAgB,EAAE,GAAG,KAAK,cAAc,kBAAkB,CAAC;AAAA,EAChE;AACJ,CAAC;AAEM,SAAS,kBAAkB,EAAE,SAAS,GAAkC;AAC3E,QAAM,cAAc,IAAI,YAAY;AACpC,SACI,oBAAC,iBAAc,QACX,8BAAC,uBAAoB,QAAQ,aAAc,UAAS,GACxD;AAER","sourcesContent":["import type React from \"react\";\nimport { createConfig, http, WagmiProvider } from \"wagmi\";\nimport {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n mainnet,\n} from \"wagmi/chains\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport { metaMask, walletConnect } from \"wagmi/connectors\";\n\nconst ALCHEMY_API_KEY = \"-7M6vRDBDknwvMxnqah_jbcieWg0qad9\";\nconst ALCHEMY_RPC_SUBDOMAIN = {\n mainnet: \"mainnet\",\n polygon: \"polygon-mainnet\",\n \"polygon-amoy\": \"polygon-amoy\",\n base: \"base-mainnet\",\n \"base-sepolia\": \"base-sepolia\",\n optimism: \"opt-mainnet\",\n \"optimism-sepolia\": \"opt-sepolia\",\n arbitrum: \"arb-mainnet\",\n \"arbitrum-sepolia\": \"arb-sepolia\",\n};\nfunction getAlchemyRPC(chain: keyof typeof ALCHEMY_RPC_SUBDOMAIN): string {\n return `https://${ALCHEMY_RPC_SUBDOMAIN[chain]}.g.alchemy.com/v2/${ALCHEMY_API_KEY}`;\n}\n\nconst config = createConfig({\n chains: [mainnet, base, polygon, optimism, arbitrum, baseSepolia, polygonAmoy, optimismSepolia, arbitrumSepolia],\n connectors: [metaMask(), walletConnect({ projectId: \"94ed8f7549329dad7be968888eec3688\" })],\n transports: {\n [mainnet.id]: http(getAlchemyRPC(\"mainnet\")),\n [base.id]: http(getAlchemyRPC(\"base\")),\n [polygon.id]: http(getAlchemyRPC(\"polygon\")),\n [optimism.id]: http(getAlchemyRPC(\"optimism\")),\n [arbitrum.id]: http(getAlchemyRPC(\"arbitrum\")),\n [baseSepolia.id]: http(getAlchemyRPC(\"base-sepolia\")),\n [polygonAmoy.id]: http(getAlchemyRPC(\"polygon-amoy\")),\n [optimismSepolia.id]: http(getAlchemyRPC(\"optimism-sepolia\")),\n [arbitrumSepolia.id]: http(getAlchemyRPC(\"arbitrum-sepolia\")),\n },\n});\n\nexport function WagmiAuthProvider({ children }: { children: React.ReactNode }) {\n const queryClient = new QueryClient();\n return (\n <WagmiProvider config={config}>\n <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>\n </WagmiProvider>\n );\n}\n"]}
|