@dynamic-labs/sdk-react-core 2.1.0-alpha.14 → 2.1.0-alpha.16
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/CHANGELOG.md +16 -0
- package/package.cjs +3 -2
- package/package.js +3 -2
- package/package.json +13 -12
- package/src/index.cjs +1 -3
- package/src/index.d.ts +1 -3
- package/src/index.js +1 -2
- package/src/lib/components/Portal/Portal.cjs +3 -1
- package/src/lib/components/Portal/Portal.js +3 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.cjs +4 -0
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.js +4 -0
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.cjs +4 -0
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.js +4 -0
- package/src/lib/context/ConnectWithOtpContext/utils/findEmailProvider.cjs +4 -0
- package/src/lib/context/ConnectWithOtpContext/utils/findEmailProvider.js +4 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +20 -15
- package/src/lib/context/DynamicContext/DynamicContext.js +20 -15
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +0 -1
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +13 -5
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +14 -6
- package/src/lib/context/DynamicContext/types/index.d.ts +4 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.cjs +2 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.d.ts +1 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.js +2 -1
- package/src/lib/context/DynamicContext/validators/validators.cjs +0 -29
- package/src/lib/context/DynamicContext/validators/validators.d.ts +0 -2
- package/src/lib/context/DynamicContext/validators/validators.js +1 -29
- package/src/lib/context/FundingContext/FundingContext.cjs +6 -6
- package/src/lib/context/FundingContext/FundingContext.js +6 -6
- package/src/lib/context/PasskeyContext/PasskeyContext.cjs +0 -1
- package/src/lib/context/PasskeyContext/PasskeyContext.js +0 -1
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/data/api/api.cjs +25 -3
- package/src/lib/data/api/api.d.ts +1 -1
- package/src/lib/data/api/api.js +25 -3
- package/src/lib/data/api/chains/balances.cjs +2 -2
- package/src/lib/data/api/chains/balances.d.ts +1 -2
- package/src/lib/data/api/chains/balances.js +2 -2
- package/src/lib/data/api/email/email.cjs +2 -2
- package/src/lib/data/api/email/email.d.ts +1 -1
- package/src/lib/data/api/email/email.js +2 -2
- package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +23 -23
- package/src/lib/data/api/embeddedWallets/embeddedWallets.d.ts +11 -12
- package/src/lib/data/api/embeddedWallets/embeddedWallets.js +23 -23
- package/src/lib/data/api/embeddedWallets/types.d.ts +0 -6
- package/src/lib/data/api/mfa/mfa.cjs +18 -18
- package/src/lib/data/api/mfa/mfa.d.ts +9 -18
- package/src/lib/data/api/mfa/mfa.js +18 -18
- package/src/lib/data/api/oauth/oauth.cjs +4 -4
- package/src/lib/data/api/oauth/oauth.d.ts +3 -3
- package/src/lib/data/api/oauth/oauth.js +4 -4
- package/src/lib/data/api/session/session.cjs +2 -2
- package/src/lib/data/api/session/session.d.ts +1 -1
- package/src/lib/data/api/session/session.js +2 -2
- package/src/lib/data/api/sms/sms.cjs +2 -2
- package/src/lib/data/api/sms/sms.d.ts +1 -1
- package/src/lib/data/api/sms/sms.js +2 -2
- package/src/lib/data/api/user/user.cjs +8 -10
- package/src/lib/data/api/user/user.d.ts +4 -4
- package/src/lib/data/api/user/user.js +9 -11
- package/src/lib/data/api/wallets/wallets.cjs +8 -8
- package/src/lib/data/api/wallets/wallets.d.ts +4 -4
- package/src/lib/data/api/wallets/wallets.js +8 -8
- package/src/lib/locale/en/translation.cjs +18 -0
- package/src/lib/locale/en/translation.d.ts +18 -0
- package/src/lib/locale/en/translation.js +18 -0
- package/src/lib/shared/utils/classes/storage/localStorage.cjs +1 -8
- package/src/lib/shared/utils/classes/storage/localStorage.js +2 -9
- package/src/lib/shared/utils/functions/index.d.ts +0 -1
- package/src/lib/store/actions/storeActions/index.d.ts +1 -0
- package/src/lib/store/actions/storeActions/storeActions.cjs +10 -0
- package/src/lib/store/actions/storeActions/storeActions.d.ts +1 -0
- package/src/lib/store/actions/storeActions/storeActions.js +6 -0
- package/src/lib/store/actions/userActions/index.d.ts +1 -0
- package/src/lib/store/actions/userActions/userActions.cjs +10 -0
- package/src/lib/store/actions/userActions/userActions.d.ts +7 -0
- package/src/lib/store/actions/userActions/userActions.js +6 -0
- package/src/lib/store/hooks/useUser/index.d.ts +1 -0
- package/src/lib/store/hooks/useUser/useUser.cjs +12 -0
- package/src/lib/store/hooks/useUser/useUser.d.ts +1 -0
- package/src/lib/store/hooks/useUser/useUser.js +8 -0
- package/src/lib/store/index.d.ts +4 -0
- package/src/lib/store/store.cjs +24 -0
- package/src/lib/store/store.d.ts +13 -0
- package/src/lib/store/store.js +19 -0
- package/src/lib/store/types.d.ts +4 -0
- package/src/lib/store/utils/createStore/createStore.cjs +21 -0
- package/src/lib/store/utils/createStore/createStore.d.ts +16 -0
- package/src/lib/store/utils/createStore/createStore.js +17 -0
- package/src/lib/store/utils/createStore/index.d.ts +1 -0
- package/src/lib/store/utils/syncLegacyStorage/index.d.ts +1 -0
- package/src/lib/store/utils/syncLegacyStorage/syncLegacyStorage.cjs +30 -0
- package/src/lib/store/utils/syncLegacyStorage/syncLegacyStorage.d.ts +2 -0
- package/src/lib/store/utils/syncLegacyStorage/syncLegacyStorage.js +26 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/index.d.ts +1 -1
- package/src/lib/utils/constants/localStorage.cjs +4 -2
- package/src/lib/utils/constants/localStorage.d.ts +2 -1
- package/src/lib/utils/constants/localStorage.js +3 -2
- package/src/lib/utils/functions/downloadFile/downloadFile.cjs +15 -0
- package/src/lib/utils/functions/downloadFile/downloadFile.d.ts +1 -0
- package/src/lib/utils/functions/downloadFile/downloadFile.js +11 -0
- package/src/lib/utils/functions/downloadFile/index.d.ts +1 -0
- package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.cjs +8 -4
- package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.d.ts +1 -2
- package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.js +8 -4
- package/src/lib/utils/functions/getOnboardingAuthToken/getOnboardingAuthToken.cjs +31 -0
- package/src/lib/utils/functions/getOnboardingAuthToken/getOnboardingAuthToken.d.ts +1 -0
- package/src/lib/utils/functions/getOnboardingAuthToken/getOnboardingAuthToken.js +27 -0
- package/src/lib/utils/functions/getOnboardingAuthToken/index.d.ts +1 -0
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.cjs +7 -3
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.js +7 -3
- package/src/lib/utils/functions/index.d.ts +2 -0
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.js +1 -1
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.cjs +2 -2
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.js +2 -2
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +4 -2
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +4 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +2 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +2 -2
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +4 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +4 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +1 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +1 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.cjs +3 -6
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.js +3 -6
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +2 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +2 -0
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.cjs +4 -4
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.js +4 -4
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.cjs +4 -0
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.js +4 -0
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +4 -4
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +4 -4
- package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.cjs +6 -3
- package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.d.ts +1 -4
- package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.js +5 -2
- package/src/lib/utils/hooks/useMergeUserAccounts/useMergeUserAccounts.cjs +1 -3
- package/src/lib/utils/hooks/useMergeUserAccounts/useMergeUserAccounts.js +1 -3
- package/src/lib/utils/hooks/useMfa/useMfa.cjs +1 -8
- package/src/lib/utils/hooks/useMfa/useMfa.js +1 -8
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +1 -1
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +1 -1
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.cjs +7 -3
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.d.ts +1 -4
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.js +6 -2
- package/src/lib/utils/hooks/useSendDynamicProps/useSendDynamicProps.cjs +2 -2
- package/src/lib/utils/hooks/useSendDynamicProps/useSendDynamicProps.js +2 -2
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +1 -1
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +1 -1
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +4 -7
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +4 -7
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +11 -14
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +11 -14
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +0 -1
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +0 -1
- package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.cjs +1 -1
- package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.js +1 -1
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +6 -1
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +6 -1
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +3 -3
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +3 -3
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -1
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +4 -4
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +4 -4
- package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.cjs +5 -10
- package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.js +5 -10
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +2 -5
- package/src/lib/views/EmailUpdate/EmailUpdate.js +2 -5
- package/src/lib/views/EmailVerification/EmailVerification.cjs +3 -1
- package/src/lib/views/EmailVerification/EmailVerification.js +3 -1
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +5 -2
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +5 -2
- package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.cjs +4 -2
- package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.js +4 -2
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.cjs +111 -0
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.d.ts +2 -0
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.js +107 -0
- package/src/lib/views/MfaDisplayBackupCodesView/index.d.ts +1 -0
- package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +3 -3
- package/src/lib/views/MfaVerificationView/MfaVerificationView.js +3 -3
- package/src/lib/views/Passkey/RenamePasskeyView/RenamePasskeyView.cjs +0 -2
- package/src/lib/views/Passkey/RenamePasskeyView/RenamePasskeyView.js +0 -2
- package/src/lib/views/Passkey/utils/createEmbeddedWalletRequest/createEmbeddedWalletRequest.cjs +3 -3
- package/src/lib/views/Passkey/utils/createEmbeddedWalletRequest/createEmbeddedWalletRequest.js +3 -3
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +4 -9
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +4 -9
- package/src/lib/views/WalletList/WalletListGridTabs/WalletListGridTabs.cjs +1 -1
- package/src/lib/views/WalletList/WalletListGridTabs/WalletListGridTabs.js +1 -1
- package/src/lib/views/WalletList/hooks/useTabState.cjs +4 -1
- package/src/lib/views/WalletList/hooks/useTabState.js +4 -1
- package/src/lib/views/WalletList/utils/getInitialTabIndex/getInitialTabIndex.cjs +22 -0
- package/src/lib/views/WalletList/utils/getInitialTabIndex/getInitialTabIndex.d.ts +2 -0
- package/src/lib/views/WalletList/utils/getInitialTabIndex/getInitialTabIndex.js +18 -0
- package/src/lib/views/WalletList/utils/getInitialTabIndex/index.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/shared/utils/functions/validateType/index.d.ts +0 -1
- package/src/lib/shared/utils/functions/validateType/validateType.cjs +0 -30
- package/src/lib/shared/utils/functions/validateType/validateType.d.ts +0 -1
- package/src/lib/shared/utils/functions/validateType/validateType.js +0 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.1.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.15...v2.1.0-alpha.16) (2024-05-14)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add client.sdk.error with errors from the webview ([#5520](https://github.com/dynamic-labs/DynamicAuth/issues/5520)) ([a886927](https://github.com/dynamic-labs/DynamicAuth/commit/a8869273bf361c870d6e3cb82a28d9ccec65905b))
|
|
8
|
+
* add setDefaultTabIndex to default the selected wallets tab ([#5593](https://github.com/dynamic-labs/DynamicAuth/issues/5593)) ([6e8ce05](https://github.com/dynamic-labs/DynamicAuth/commit/6e8ce053c4f6f009acc57dac55a8e9c74fbcc73b))
|
|
9
|
+
* add visibility/auth-flow/user-profile to react-native ([#5564](https://github.com/dynamic-labs/DynamicAuth/issues/5564)) ([d93cea8](https://github.com/dynamic-labs/DynamicAuth/commit/d93cea82a123c6ec4d3d594a7dc064f4db2981c2))
|
|
10
|
+
|
|
11
|
+
## [2.1.0-alpha.15](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.14...v2.1.0-alpha.15) (2024-05-13)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* when a pregen is created, primaryWallet is not being setup ([#5584](https://github.com/dynamic-labs/DynamicAuth/issues/5584)) ([de08721](https://github.com/dynamic-labs/DynamicAuth/commit/de0872151e09f91dcbfaf1d043cf830f9df8d799))
|
|
17
|
+
|
|
2
18
|
## [2.1.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.13...v2.1.0-alpha.14) (2024-05-09)
|
|
3
19
|
|
|
4
20
|
|
package/package.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var version = "2.1.0-alpha.
|
|
6
|
+
var version = "2.1.0-alpha.16";
|
|
7
7
|
var dependencies = {
|
|
8
8
|
"@dynamic-labs/sdk-api-core": "0.0.433",
|
|
9
9
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
@@ -14,7 +14,8 @@ var dependencies = {
|
|
|
14
14
|
"react-focus-lock": "2.9.2",
|
|
15
15
|
"react-i18next": "13.5.0",
|
|
16
16
|
yup: "0.32.11",
|
|
17
|
-
"react-international-phone": "4.2.5"
|
|
17
|
+
"react-international-phone": "4.2.5",
|
|
18
|
+
zustand: "4.5.2"
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
exports.dependencies = dependencies;
|
package/package.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
var version = "2.1.0-alpha.
|
|
2
|
+
var version = "2.1.0-alpha.16";
|
|
3
3
|
var dependencies = {
|
|
4
4
|
"@dynamic-labs/sdk-api-core": "0.0.433",
|
|
5
5
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
@@ -10,7 +10,8 @@ var dependencies = {
|
|
|
10
10
|
"react-focus-lock": "2.9.2",
|
|
11
11
|
"react-i18next": "13.5.0",
|
|
12
12
|
yup: "0.32.11",
|
|
13
|
-
"react-international-phone": "4.2.5"
|
|
13
|
+
"react-international-phone": "4.2.5",
|
|
14
|
+
zustand: "4.5.2"
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
export { dependencies, version };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.16",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -17,17 +17,18 @@
|
|
|
17
17
|
"react-i18next": "13.5.0",
|
|
18
18
|
"yup": "0.32.11",
|
|
19
19
|
"react-international-phone": "4.2.5",
|
|
20
|
-
"
|
|
21
|
-
"@dynamic-labs/
|
|
22
|
-
"@dynamic-labs/
|
|
23
|
-
"@dynamic-labs/
|
|
24
|
-
"@dynamic-labs/rpc-provider-
|
|
25
|
-
"@dynamic-labs/rpc-
|
|
26
|
-
"@dynamic-labs/
|
|
27
|
-
"@dynamic-labs/
|
|
28
|
-
"@dynamic-labs/
|
|
29
|
-
"@dynamic-labs/
|
|
30
|
-
"@dynamic-labs/wallet-
|
|
20
|
+
"zustand": "4.5.2",
|
|
21
|
+
"@dynamic-labs/iconic": "2.1.0-alpha.16",
|
|
22
|
+
"@dynamic-labs/logger": "2.1.0-alpha.16",
|
|
23
|
+
"@dynamic-labs/multi-wallet": "2.1.0-alpha.16",
|
|
24
|
+
"@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.16",
|
|
25
|
+
"@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.16",
|
|
26
|
+
"@dynamic-labs/rpc-providers": "2.1.0-alpha.16",
|
|
27
|
+
"@dynamic-labs/types": "2.1.0-alpha.16",
|
|
28
|
+
"@dynamic-labs/utils": "2.1.0-alpha.16",
|
|
29
|
+
"@dynamic-labs/viem-utils": "2.1.0-alpha.16",
|
|
30
|
+
"@dynamic-labs/wallet-book": "2.1.0-alpha.16",
|
|
31
|
+
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.16",
|
|
31
32
|
"eventemitter3": "5.0.1"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
package/src/index.cjs
CHANGED
|
@@ -22,7 +22,6 @@ var useWalletConnectorEvent = require('./lib/utils/hooks/events/useWalletConnect
|
|
|
22
22
|
var useAuthenticateConnectedUser = require('./lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.cjs');
|
|
23
23
|
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
24
24
|
require('./lib/shared/logger.cjs');
|
|
25
|
-
var validateType = require('./lib/shared/utils/functions/validateType/validateType.cjs');
|
|
26
25
|
var getChainIcon = require('./lib/shared/utils/functions/chain/getChainIcon.cjs');
|
|
27
26
|
var getChainDisplayName = require('./lib/shared/utils/functions/chain/getChainDisplayName.cjs');
|
|
28
27
|
var createWallet = require('./lib/shared/utils/functions/wallet/createWallet.cjs');
|
|
@@ -57,12 +56,12 @@ require('./lib/shared/consts/index.cjs');
|
|
|
57
56
|
require('../_virtual/_tslib.cjs');
|
|
58
57
|
require('react-dom');
|
|
59
58
|
require('./lib/config/ApiEndpoint.cjs');
|
|
60
|
-
require('./lib/locale/locale.cjs');
|
|
61
59
|
require('@dynamic-labs/wallet-connector-core');
|
|
62
60
|
require('@dynamic-labs/multi-wallet');
|
|
63
61
|
require('react-international-phone');
|
|
64
62
|
var mergeNetworks = require('./lib/utils/functions/mergeNetworks/mergeNetworks.cjs');
|
|
65
63
|
var createWalletClientFromWallet = require('./lib/utils/functions/createWalletClientFromWallet/createWalletClientFromWallet.cjs');
|
|
64
|
+
require('./lib/locale/locale.cjs');
|
|
66
65
|
var useEmbeddedWallet = require('./lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs');
|
|
67
66
|
require('./lib/context/WalletContext/WalletContext.cjs');
|
|
68
67
|
require('./lib/context/ErrorContext/ErrorContext.cjs');
|
|
@@ -167,7 +166,6 @@ Object.defineProperty(exports, 'DynamicJwtFromJSON', {
|
|
|
167
166
|
enumerable: true,
|
|
168
167
|
get: function () { return sdkApiCore.DynamicJwtFromJSON; }
|
|
169
168
|
});
|
|
170
|
-
exports.validateType = validateType.validateType;
|
|
171
169
|
exports.getChainIcon = getChainIcon.getChainIcon;
|
|
172
170
|
exports.getChainDisplayName = getChainDisplayName.getChainDisplayName;
|
|
173
171
|
exports.createWallet = createWallet.createWallet;
|
package/src/index.d.ts
CHANGED
|
@@ -61,9 +61,7 @@ SpinnerIcon, type AccessDeniedCustomButton, type AccountSwitchState, type AuthMo
|
|
|
61
61
|
/** @deprecated */
|
|
62
62
|
useLocalStorage,
|
|
63
63
|
/** @deprecated */
|
|
64
|
-
useOnClickOutside,
|
|
65
|
-
/** @deprecated */
|
|
66
|
-
validateType, } from './lib/shared';
|
|
64
|
+
useOnClickOutside, } from './lib/shared';
|
|
67
65
|
export {
|
|
68
66
|
/** @deprecated */
|
|
69
67
|
CollectUserDataView,
|
package/src/index.js
CHANGED
|
@@ -18,7 +18,6 @@ export { useWalletConnectorEvent } from './lib/utils/hooks/events/useWalletConne
|
|
|
18
18
|
export { useAuthenticateConnectedUser } from './lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.js';
|
|
19
19
|
export { DynamicJwtFromJSON } from '@dynamic-labs/sdk-api-core';
|
|
20
20
|
import './lib/shared/logger.js';
|
|
21
|
-
export { validateType } from './lib/shared/utils/functions/validateType/validateType.js';
|
|
22
21
|
export { getChainIcon } from './lib/shared/utils/functions/chain/getChainIcon.js';
|
|
23
22
|
export { getChainDisplayName } from './lib/shared/utils/functions/chain/getChainDisplayName.js';
|
|
24
23
|
export { createWallet } from './lib/shared/utils/functions/wallet/createWallet.js';
|
|
@@ -53,12 +52,12 @@ import './lib/shared/consts/index.js';
|
|
|
53
52
|
import '../_virtual/_tslib.js';
|
|
54
53
|
import 'react-dom';
|
|
55
54
|
import './lib/config/ApiEndpoint.js';
|
|
56
|
-
import './lib/locale/locale.js';
|
|
57
55
|
import '@dynamic-labs/wallet-connector-core';
|
|
58
56
|
import '@dynamic-labs/multi-wallet';
|
|
59
57
|
import 'react-international-phone';
|
|
60
58
|
export { mergeNetworks } from './lib/utils/functions/mergeNetworks/mergeNetworks.js';
|
|
61
59
|
export { createWalletClientFromWallet } from './lib/utils/functions/createWalletClientFromWallet/createWalletClientFromWallet.js';
|
|
60
|
+
import './lib/locale/locale.js';
|
|
62
61
|
export { useEmbeddedWallet } from './lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js';
|
|
63
62
|
import './lib/context/WalletContext/WalletContext.js';
|
|
64
63
|
import './lib/context/ErrorContext/ErrorContext.js';
|
|
@@ -87,7 +87,9 @@ const ModalComponent = ({ children, handleClose, withBackdrop = true, zIndex, wh
|
|
|
87
87
|
view.type !== 'login-with-email-verification' &&
|
|
88
88
|
view.type !== 'login-with-sms-verification' &&
|
|
89
89
|
view.type !== 'verify-sms' &&
|
|
90
|
-
view.type !== 'verify-email'
|
|
90
|
+
view.type !== 'verify-email' &&
|
|
91
|
+
view.type !== 'mfa-verification' &&
|
|
92
|
+
view.type !== 'mfa-display-backup-codes';
|
|
91
93
|
const onBackdropClick = (e) => {
|
|
92
94
|
if (!shouldCloseOnBackdropClick)
|
|
93
95
|
return;
|
|
@@ -79,7 +79,9 @@ const ModalComponent = ({ children, handleClose, withBackdrop = true, zIndex, wh
|
|
|
79
79
|
view.type !== 'login-with-email-verification' &&
|
|
80
80
|
view.type !== 'login-with-sms-verification' &&
|
|
81
81
|
view.type !== 'verify-sms' &&
|
|
82
|
-
view.type !== 'verify-email'
|
|
82
|
+
view.type !== 'verify-email' &&
|
|
83
|
+
view.type !== 'mfa-verification' &&
|
|
84
|
+
view.type !== 'mfa-display-backup-codes';
|
|
83
85
|
const onBackdropClick = (e) => {
|
|
84
86
|
if (!shouldCloseOnBackdropClick)
|
|
85
87
|
return;
|
|
@@ -19,6 +19,10 @@ require('../../../utils/constants/values.cjs');
|
|
|
19
19
|
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
20
20
|
require('../../../shared/consts/index.cjs');
|
|
21
21
|
require('../../../config/ApiEndpoint.cjs');
|
|
22
|
+
require('@dynamic-labs/multi-wallet');
|
|
23
|
+
require('react-international-phone');
|
|
24
|
+
require('viem');
|
|
25
|
+
require('viem/chains');
|
|
22
26
|
require('../../../locale/locale.cjs');
|
|
23
27
|
|
|
24
28
|
const createEmailHandler = (environmentId, createUserProfileByJWT) => (email$1) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -15,6 +15,10 @@ import '../../../utils/constants/values.js';
|
|
|
15
15
|
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
16
16
|
import '../../../shared/consts/index.js';
|
|
17
17
|
import '../../../config/ApiEndpoint.js';
|
|
18
|
+
import '@dynamic-labs/multi-wallet';
|
|
19
|
+
import 'react-international-phone';
|
|
20
|
+
import 'viem';
|
|
21
|
+
import 'viem/chains';
|
|
18
22
|
import '../../../locale/locale.js';
|
|
19
23
|
|
|
20
24
|
const createEmailHandler = (environmentId, createUserProfileByJWT) => (email) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -18,6 +18,10 @@ require('../../../utils/constants/values.cjs');
|
|
|
18
18
|
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
19
19
|
require('../../../shared/consts/index.cjs');
|
|
20
20
|
require('../../../config/ApiEndpoint.cjs');
|
|
21
|
+
require('@dynamic-labs/multi-wallet');
|
|
22
|
+
require('react-international-phone');
|
|
23
|
+
require('viem');
|
|
24
|
+
require('viem/chains');
|
|
21
25
|
var sms = require('../../../data/api/sms/sms.cjs');
|
|
22
26
|
|
|
23
27
|
const createSmsHandler = (environmentId, createUserProfileByJWT) => (phone) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -14,6 +14,10 @@ import '../../../utils/constants/values.js';
|
|
|
14
14
|
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
15
15
|
import '../../../shared/consts/index.js';
|
|
16
16
|
import '../../../config/ApiEndpoint.js';
|
|
17
|
+
import '@dynamic-labs/multi-wallet';
|
|
18
|
+
import 'react-international-phone';
|
|
19
|
+
import 'viem';
|
|
20
|
+
import 'viem/chains';
|
|
17
21
|
import { createSmsVerification, signInWithSmsVerification } from '../../../data/api/sms/sms.js';
|
|
18
22
|
|
|
19
23
|
const createSmsHandler = (environmentId, createUserProfileByJWT) => (phone) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -19,6 +19,10 @@ require('../../../utils/constants/values.cjs');
|
|
|
19
19
|
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
20
20
|
require('../../../shared/consts/index.cjs');
|
|
21
21
|
require('../../../config/ApiEndpoint.cjs');
|
|
22
|
+
require('@dynamic-labs/multi-wallet');
|
|
23
|
+
require('react-international-phone');
|
|
24
|
+
require('viem');
|
|
25
|
+
require('viem/chains');
|
|
22
26
|
require('../../../locale/locale.cjs');
|
|
23
27
|
var constants = require('../constants.cjs');
|
|
24
28
|
|
|
@@ -15,6 +15,10 @@ import '../../../utils/constants/values.js';
|
|
|
15
15
|
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
16
16
|
import '../../../shared/consts/index.js';
|
|
17
17
|
import '../../../config/ApiEndpoint.js';
|
|
18
|
+
import '@dynamic-labs/multi-wallet';
|
|
19
|
+
import 'react-international-phone';
|
|
20
|
+
import 'viem';
|
|
21
|
+
import 'viem/chains';
|
|
18
22
|
import '../../../locale/locale.js';
|
|
19
23
|
import { allSupportedProviders } from '../constants.js';
|
|
20
24
|
|
|
@@ -30,6 +30,7 @@ var ErrorContext = require('../ErrorContext/ErrorContext.cjs');
|
|
|
30
30
|
require('@dynamic-labs/multi-wallet');
|
|
31
31
|
var getAuthToken = require('../../utils/functions/getAuthToken/getAuthToken.cjs');
|
|
32
32
|
var getMinAuthToken = require('../../utils/functions/getMinAuthToken/getMinAuthToken.cjs');
|
|
33
|
+
var helpers = require('./helpers/helpers.cjs');
|
|
33
34
|
require('react-international-phone');
|
|
34
35
|
require('viem');
|
|
35
36
|
require('viem/chains');
|
|
@@ -114,7 +115,9 @@ var FundingContext = require('../FundingContext/FundingContext.cjs');
|
|
|
114
115
|
var PhantomRedirectContext = require('../PhantomRedirectContext/PhantomRedirectContext.cjs');
|
|
115
116
|
var SendBalanceContext = require('../SendBalanceContext/SendBalanceContext.cjs');
|
|
116
117
|
var UseNetworkValidation = require('../UseNetworkValidation/UseNetworkValidation.cjs');
|
|
117
|
-
var
|
|
118
|
+
var userActions = require('../../store/actions/userActions/userActions.cjs');
|
|
119
|
+
var store = require('../../store/store.cjs');
|
|
120
|
+
var useUser = require('../../store/hooks/useUser/useUser.cjs');
|
|
118
121
|
var useDisplayOrderState = require('./hooks/useDisplayOrderState/useDisplayOrderState.cjs');
|
|
119
122
|
var useEmailLoginState = require('./hooks/useEmailLoginState/useEmailLoginState.cjs');
|
|
120
123
|
var useHandleLogout = require('./hooks/useHandleLogout/useHandleLogout.cjs');
|
|
@@ -126,15 +129,20 @@ var useTieCallbacksToEvents = require('./hooks/useTieCallbacksToEvents/useTieCal
|
|
|
126
129
|
var useMultiWallet = require('./hooks/useMultiWallet/useMultiWallet.cjs');
|
|
127
130
|
var useParentDynamicContextGuard = require('./hooks/useParentDynamicContextGuard/useParentDynamicContextGuard.cjs');
|
|
128
131
|
var useCustomerCallbacks = require('./useCustomerCallbacks/useCustomerCallbacks.cjs');
|
|
129
|
-
var validators = require('./validators/validators.cjs');
|
|
130
132
|
|
|
131
133
|
const PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID = '2762a57b-faa4-41ce-9f16-abff9300e2c9';
|
|
132
|
-
const EMPTY_INITIAL_USER = undefined;
|
|
133
134
|
const DynamicContext = React.createContext(undefined);
|
|
134
135
|
/** The context provider itself we only use internally */
|
|
135
136
|
const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, locale: locale$1, }) => {
|
|
136
137
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
137
|
-
const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, enableConnectOnlyFallback = false, deepLinkPreference: deepLinkPreferenceProp = 'native', bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = values.DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId,
|
|
138
|
+
const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, enableConnectOnlyFallback = false, deepLinkPreference: deepLinkPreferenceProp = 'native', bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = values.DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, walletsFilter, logLevel = 'WARN', mobileExperience = 'in-app-browser', notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = false, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, hideEmbeddedWalletTransactionUIs, handlers, } = settings$1;
|
|
139
|
+
localStorage.LocalStorage.setSuffix(settings$1.localStorageSuffix);
|
|
140
|
+
/**
|
|
141
|
+
* initialize global store
|
|
142
|
+
*/
|
|
143
|
+
store.initializeStore({
|
|
144
|
+
storageSuffix: settings$1.localStorageSuffix,
|
|
145
|
+
});
|
|
138
146
|
/**
|
|
139
147
|
* For backwards compatibility, we allow the client to pass in
|
|
140
148
|
* `eventsCallbacks` instead of `events`. It should remove this
|
|
@@ -156,12 +164,12 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
156
164
|
logger$1.logger.warn(`WARNING: DYNAMIC is using a test environment ID ${environmentId}. Please sign up on https://app.dynamic.xyz/ to get your production environment ID.`);
|
|
157
165
|
}
|
|
158
166
|
ApiEndpoint.setBaseUrl((_b = process.env.DYNAMIC_API_BASE_URL) !== null && _b !== void 0 ? _b : apiBaseUrl);
|
|
159
|
-
localStorage.LocalStorage.setSuffix(localStorageSuffix);
|
|
160
167
|
const i18nSDKInstance = locale.Locale.setup(locale$1);
|
|
161
168
|
const isAuthenticated = Boolean(getAuthToken.getAuthToken());
|
|
162
169
|
const isBridgeFlow = Boolean(bridgeChains);
|
|
163
170
|
const deepLinkPreference = helpers.getDeepLinkPreference(deepLinkPreferenceProp, isBridgeFlow);
|
|
164
171
|
const [onboardingOnlyJwt, setOnboardingOnlyJwt] = React.useState(undefined);
|
|
172
|
+
const [defaultTabIndex, setDefaultTabIndex] = React.useState(0);
|
|
165
173
|
// state to track the full connectivity status of the individual's wallets.
|
|
166
174
|
// Set to true once the predetermined number of wallets is connected.
|
|
167
175
|
const [bridgeOnboardingCompleted, setBridgeOnboardingCompleted, removeBridgeOnboardingCompleted,] = useLocalStorage.useLocalStorage(localStorage$1.BRIDGE_ONBOARDING_COMPLETED, false);
|
|
@@ -170,7 +178,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
170
178
|
// Alows clients to control the Bridget Widget flow without need to click on Bridge Widget
|
|
171
179
|
const [showBridgeWidget, setShowBridgeWidget] = React.useState(false);
|
|
172
180
|
const [isSingleWalletAccount, setIsSingleWalletAccount] = React.useState(false);
|
|
173
|
-
const
|
|
181
|
+
const user = useUser.useUser();
|
|
174
182
|
if (user) {
|
|
175
183
|
logger$1.logger.setMetaData('user', user);
|
|
176
184
|
}
|
|
@@ -231,7 +239,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
231
239
|
const { clearPrimaryWalletId, primaryWalletId, setPrimaryWalletId } = usePrimaryWalletId.usePrimaryWalletId({
|
|
232
240
|
environmentId,
|
|
233
241
|
minAuthToken: getMinAuthToken.getMinAuthToken(),
|
|
234
|
-
setUser,
|
|
235
242
|
});
|
|
236
243
|
// this is a state because it's set based on primaryWallet and bridgeChainsToConnect,
|
|
237
244
|
// which are only available further down and have would have circular dependencies
|
|
@@ -314,7 +321,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
314
321
|
removeConnectedNameService,
|
|
315
322
|
removeConnectedWalletsInfo,
|
|
316
323
|
removeLsSettings,
|
|
317
|
-
removeUser,
|
|
318
324
|
resetLoginWithEmail,
|
|
319
325
|
setAuthMode,
|
|
320
326
|
setLegacyIsVerifying,
|
|
@@ -342,7 +348,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
342
348
|
environmentId,
|
|
343
349
|
primaryWalletId,
|
|
344
350
|
secondaryWallets,
|
|
345
|
-
setUser,
|
|
346
351
|
verifiedCredentials: (user === null || user === void 0 ? void 0 : user.verifiedCredentials) || [],
|
|
347
352
|
});
|
|
348
353
|
const { isLoading: loadingNetwork, network } = useWalletConnectorNetwork.useWalletConnectorNetwork(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
|
|
@@ -399,9 +404,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
399
404
|
if (authMode !== 'connect-only') {
|
|
400
405
|
removeConnectedWalletsInfo();
|
|
401
406
|
}
|
|
402
|
-
if (!localStorage.LocalStorage.getFromLS(localStorage$1.AUTH_USER)) {
|
|
403
|
-
localStorage.LocalStorage.removeFromLS(localStorage$1.AUTH_TOKEN);
|
|
404
|
-
}
|
|
405
407
|
if (localStorage.LocalStorage.getFromLS(localStorage$1.WALLET_PICKER_SEARCH_KEY)) {
|
|
406
408
|
localStorage.LocalStorage.removeFromLS(localStorage$1.WALLET_PICKER_SEARCH_KEY);
|
|
407
409
|
}
|
|
@@ -447,6 +449,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
447
449
|
debugError,
|
|
448
450
|
decodedOnboardingOnlyToken: decodeJwt.decodeJwt(onboardingOnlyJwt),
|
|
449
451
|
defaultNumberOfWalletsToShow,
|
|
452
|
+
defaultTabIndex,
|
|
450
453
|
desktopUri,
|
|
451
454
|
disconnectWallet,
|
|
452
455
|
displaySiweStatement,
|
|
@@ -503,6 +506,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
503
506
|
setAuthorizationViewDisplayOrder,
|
|
504
507
|
setBridgeOnboardingCompleted,
|
|
505
508
|
setCallback,
|
|
509
|
+
setDefaultTabIndex,
|
|
506
510
|
setDesktopUri,
|
|
507
511
|
setIsSingleWalletAccount,
|
|
508
512
|
setLegacyIsVerifying,
|
|
@@ -520,7 +524,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
520
524
|
setShowDynamicUserProfile,
|
|
521
525
|
setShowQrcodeModal,
|
|
522
526
|
setShowWidgetStatePopup,
|
|
523
|
-
setUser,
|
|
527
|
+
setUser: userActions.setUser,
|
|
524
528
|
shadowDOMEnabled,
|
|
525
529
|
showAuthFlow,
|
|
526
530
|
showBridgeWidget,
|
|
@@ -551,6 +555,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
551
555
|
handlers,
|
|
552
556
|
appLogoUrl,
|
|
553
557
|
appName,
|
|
558
|
+
defaultTabIndex,
|
|
554
559
|
authMode,
|
|
555
560
|
authorizationViewDisplayOrder,
|
|
556
561
|
awaitingSignatureState,
|
|
@@ -627,7 +632,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
627
632
|
setSelectedWalletConnectorKey,
|
|
628
633
|
setShowAuthFlow,
|
|
629
634
|
setShowQrcodeModal,
|
|
630
|
-
setUser,
|
|
631
635
|
shadowDOMEnabled,
|
|
632
636
|
showAuthFlow,
|
|
633
637
|
showBridgeWidget,
|
|
@@ -683,7 +687,8 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
683
687
|
if (user && multiWalletWidgetState !== 'idle' && !showDynamicUserProfile) {
|
|
684
688
|
setShowDynamicUserProfile(true);
|
|
685
689
|
}
|
|
686
|
-
|
|
690
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
691
|
+
}, [multiWallet, multiWalletWidgetState, showDynamicUserProfile]);
|
|
687
692
|
return (jsxRuntime.jsx(reactI18next.I18nextProvider, { i18n: i18nSDKInstance, children: jsxRuntime.jsx(DynamicContext.Provider, { value: value, children: jsxRuntime.jsx(walletBook.WalletBookContextProvider, { walletBook: walletBook$1, children: jsxRuntime.jsx(ThemeContext.ThemeContextProvider, { customerTheme: parseTheme.parseTheme(theme, ((_g = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _g === void 0 ? void 0 : _g.modal) || undefined), designSettings: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design, children: jsxRuntime.jsx(LoadingContext.LoadingContextProvider, { children: jsxRuntime.jsxs(ViewContext.ViewContextProvider, { initialView: helpers.getInitialView({
|
|
688
693
|
bridgeOnboardingCompleted,
|
|
689
694
|
connectedWallets,
|
|
@@ -14,7 +14,7 @@ import { decodeJwt } from '../../shared/utils/functions/decodeJwt/decodeJwt.js';
|
|
|
14
14
|
import '@dynamic-labs/sdk-api-core';
|
|
15
15
|
import { logger } from '../../shared/logger.js';
|
|
16
16
|
import { ViewContextProvider } from '../ViewContext/ViewContext.js';
|
|
17
|
-
import { BRIDGE_ONBOARDING_COMPLETED,
|
|
17
|
+
import { BRIDGE_ONBOARDING_COMPLETED, AUTH_MODE, WALLET_PICKER_SEARCH_KEY, PHANTOM_SIGNATURE_STATE } from '../../utils/constants/localStorage.js';
|
|
18
18
|
import '../../utils/constants/colors.js';
|
|
19
19
|
import { DEFAULT_NUMBER_OF_WALLETS_TO_SHOW } from '../../utils/constants/values.js';
|
|
20
20
|
import { LocalStorage } from '../../shared/utils/classes/storage/localStorage.js';
|
|
@@ -26,6 +26,7 @@ import { ErrorContextProvider } from '../ErrorContext/ErrorContext.js';
|
|
|
26
26
|
import '@dynamic-labs/multi-wallet';
|
|
27
27
|
import { getAuthToken } from '../../utils/functions/getAuthToken/getAuthToken.js';
|
|
28
28
|
import { getMinAuthToken } from '../../utils/functions/getMinAuthToken/getMinAuthToken.js';
|
|
29
|
+
import { resolveNetworkValidationMode, initExpirationTime, getInitialView, getDeepLinkPreference } from './helpers/helpers.js';
|
|
29
30
|
import 'react-international-phone';
|
|
30
31
|
import 'viem';
|
|
31
32
|
import 'viem/chains';
|
|
@@ -110,7 +111,9 @@ import { FundingContextProvider } from '../FundingContext/FundingContext.js';
|
|
|
110
111
|
import { PhantomRedirectContextProvider } from '../PhantomRedirectContext/PhantomRedirectContext.js';
|
|
111
112
|
import { SendBalanceContextProvider } from '../SendBalanceContext/SendBalanceContext.js';
|
|
112
113
|
import { UseNetworkValidation } from '../UseNetworkValidation/UseNetworkValidation.js';
|
|
113
|
-
import {
|
|
114
|
+
import { setUser } from '../../store/actions/userActions/userActions.js';
|
|
115
|
+
import { initializeStore } from '../../store/store.js';
|
|
116
|
+
import { useUser } from '../../store/hooks/useUser/useUser.js';
|
|
114
117
|
import { useDisplayOrderState } from './hooks/useDisplayOrderState/useDisplayOrderState.js';
|
|
115
118
|
import { useEmailLoginState } from './hooks/useEmailLoginState/useEmailLoginState.js';
|
|
116
119
|
import { useHandleLogout } from './hooks/useHandleLogout/useHandleLogout.js';
|
|
@@ -122,15 +125,20 @@ import { useTieCallbacksToEvents } from './hooks/useTieCallbacksToEvents/useTieC
|
|
|
122
125
|
import { useMultiWallet } from './hooks/useMultiWallet/useMultiWallet.js';
|
|
123
126
|
import { useParentDynamicContextGuard } from './hooks/useParentDynamicContextGuard/useParentDynamicContextGuard.js';
|
|
124
127
|
import { useCustomerCallbacks } from './useCustomerCallbacks/useCustomerCallbacks.js';
|
|
125
|
-
import { validateAuthUser } from './validators/validators.js';
|
|
126
128
|
|
|
127
129
|
const PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID = '2762a57b-faa4-41ce-9f16-abff9300e2c9';
|
|
128
|
-
const EMPTY_INITIAL_USER = undefined;
|
|
129
130
|
const DynamicContext = createContext(undefined);
|
|
130
131
|
/** The context provider itself we only use internally */
|
|
131
132
|
const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) => {
|
|
132
133
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
133
|
-
const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, enableConnectOnlyFallback = false, deepLinkPreference: deepLinkPreferenceProp = 'native', bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId,
|
|
134
|
+
const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, enableConnectOnlyFallback = false, deepLinkPreference: deepLinkPreferenceProp = 'native', bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, walletsFilter, logLevel = 'WARN', mobileExperience = 'in-app-browser', notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = false, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, hideEmbeddedWalletTransactionUIs, handlers, } = settings;
|
|
135
|
+
LocalStorage.setSuffix(settings.localStorageSuffix);
|
|
136
|
+
/**
|
|
137
|
+
* initialize global store
|
|
138
|
+
*/
|
|
139
|
+
initializeStore({
|
|
140
|
+
storageSuffix: settings.localStorageSuffix,
|
|
141
|
+
});
|
|
134
142
|
/**
|
|
135
143
|
* For backwards compatibility, we allow the client to pass in
|
|
136
144
|
* `eventsCallbacks` instead of `events`. It should remove this
|
|
@@ -152,12 +160,12 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
|
|
|
152
160
|
logger.warn(`WARNING: DYNAMIC is using a test environment ID ${environmentId}. Please sign up on https://app.dynamic.xyz/ to get your production environment ID.`);
|
|
153
161
|
}
|
|
154
162
|
ApiEndpoint.setBaseUrl((_b = process.env.DYNAMIC_API_BASE_URL) !== null && _b !== void 0 ? _b : apiBaseUrl);
|
|
155
|
-
LocalStorage.setSuffix(localStorageSuffix);
|
|
156
163
|
const i18nSDKInstance = Locale.setup(locale);
|
|
157
164
|
const isAuthenticated = Boolean(getAuthToken());
|
|
158
165
|
const isBridgeFlow = Boolean(bridgeChains);
|
|
159
166
|
const deepLinkPreference = getDeepLinkPreference(deepLinkPreferenceProp, isBridgeFlow);
|
|
160
167
|
const [onboardingOnlyJwt, setOnboardingOnlyJwt] = useState(undefined);
|
|
168
|
+
const [defaultTabIndex, setDefaultTabIndex] = useState(0);
|
|
161
169
|
// state to track the full connectivity status of the individual's wallets.
|
|
162
170
|
// Set to true once the predetermined number of wallets is connected.
|
|
163
171
|
const [bridgeOnboardingCompleted, setBridgeOnboardingCompleted, removeBridgeOnboardingCompleted,] = useLocalStorage(BRIDGE_ONBOARDING_COMPLETED, false);
|
|
@@ -166,7 +174,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
|
|
|
166
174
|
// Alows clients to control the Bridget Widget flow without need to click on Bridge Widget
|
|
167
175
|
const [showBridgeWidget, setShowBridgeWidget] = useState(false);
|
|
168
176
|
const [isSingleWalletAccount, setIsSingleWalletAccount] = useState(false);
|
|
169
|
-
const
|
|
177
|
+
const user = useUser();
|
|
170
178
|
if (user) {
|
|
171
179
|
logger.setMetaData('user', user);
|
|
172
180
|
}
|
|
@@ -227,7 +235,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
|
|
|
227
235
|
const { clearPrimaryWalletId, primaryWalletId, setPrimaryWalletId } = usePrimaryWalletId({
|
|
228
236
|
environmentId,
|
|
229
237
|
minAuthToken: getMinAuthToken(),
|
|
230
|
-
setUser,
|
|
231
238
|
});
|
|
232
239
|
// this is a state because it's set based on primaryWallet and bridgeChainsToConnect,
|
|
233
240
|
// which are only available further down and have would have circular dependencies
|
|
@@ -310,7 +317,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
|
|
|
310
317
|
removeConnectedNameService,
|
|
311
318
|
removeConnectedWalletsInfo,
|
|
312
319
|
removeLsSettings,
|
|
313
|
-
removeUser,
|
|
314
320
|
resetLoginWithEmail,
|
|
315
321
|
setAuthMode,
|
|
316
322
|
setLegacyIsVerifying,
|
|
@@ -338,7 +344,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
|
|
|
338
344
|
environmentId,
|
|
339
345
|
primaryWalletId,
|
|
340
346
|
secondaryWallets,
|
|
341
|
-
setUser,
|
|
342
347
|
verifiedCredentials: (user === null || user === void 0 ? void 0 : user.verifiedCredentials) || [],
|
|
343
348
|
});
|
|
344
349
|
const { isLoading: loadingNetwork, network } = useWalletConnectorNetwork(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
|
|
@@ -395,9 +400,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
|
|
|
395
400
|
if (authMode !== 'connect-only') {
|
|
396
401
|
removeConnectedWalletsInfo();
|
|
397
402
|
}
|
|
398
|
-
if (!LocalStorage.getFromLS(AUTH_USER)) {
|
|
399
|
-
LocalStorage.removeFromLS(AUTH_TOKEN);
|
|
400
|
-
}
|
|
401
403
|
if (LocalStorage.getFromLS(WALLET_PICKER_SEARCH_KEY)) {
|
|
402
404
|
LocalStorage.removeFromLS(WALLET_PICKER_SEARCH_KEY);
|
|
403
405
|
}
|
|
@@ -443,6 +445,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
|
|
|
443
445
|
debugError,
|
|
444
446
|
decodedOnboardingOnlyToken: decodeJwt(onboardingOnlyJwt),
|
|
445
447
|
defaultNumberOfWalletsToShow,
|
|
448
|
+
defaultTabIndex,
|
|
446
449
|
desktopUri,
|
|
447
450
|
disconnectWallet,
|
|
448
451
|
displaySiweStatement,
|
|
@@ -499,6 +502,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
|
|
|
499
502
|
setAuthorizationViewDisplayOrder,
|
|
500
503
|
setBridgeOnboardingCompleted,
|
|
501
504
|
setCallback,
|
|
505
|
+
setDefaultTabIndex,
|
|
502
506
|
setDesktopUri,
|
|
503
507
|
setIsSingleWalletAccount,
|
|
504
508
|
setLegacyIsVerifying,
|
|
@@ -547,6 +551,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
|
|
|
547
551
|
handlers,
|
|
548
552
|
appLogoUrl,
|
|
549
553
|
appName,
|
|
554
|
+
defaultTabIndex,
|
|
550
555
|
authMode,
|
|
551
556
|
authorizationViewDisplayOrder,
|
|
552
557
|
awaitingSignatureState,
|
|
@@ -623,7 +628,6 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
|
|
|
623
628
|
setSelectedWalletConnectorKey,
|
|
624
629
|
setShowAuthFlow,
|
|
625
630
|
setShowQrcodeModal,
|
|
626
|
-
setUser,
|
|
627
631
|
shadowDOMEnabled,
|
|
628
632
|
showAuthFlow,
|
|
629
633
|
showBridgeWidget,
|
|
@@ -679,7 +683,8 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
|
|
|
679
683
|
if (user && multiWalletWidgetState !== 'idle' && !showDynamicUserProfile) {
|
|
680
684
|
setShowDynamicUserProfile(true);
|
|
681
685
|
}
|
|
682
|
-
|
|
686
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
687
|
+
}, [multiWallet, multiWalletWidgetState, showDynamicUserProfile]);
|
|
683
688
|
return (jsx(I18nextProvider, { i18n: i18nSDKInstance, children: jsx(DynamicContext.Provider, { value: value, children: jsx(WalletBookContextProvider, { walletBook: walletBook, children: jsx(ThemeContextProvider, { customerTheme: parseTheme(theme, ((_g = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _g === void 0 ? void 0 : _g.modal) || undefined), designSettings: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design, children: jsx(LoadingContextProvider, { children: jsxs(ViewContextProvider, { initialView: getInitialView({
|
|
684
689
|
bridgeOnboardingCompleted,
|
|
685
690
|
connectedWallets,
|
|
@@ -6,7 +6,6 @@ import { MultiWalletWidgetStateSetter } from '../../../../utils/hooks/multiWalle
|
|
|
6
6
|
import { ChainsToConnect } from '../../types';
|
|
7
7
|
import { SetShowAuthFlow } from '../useShowAuthFlow';
|
|
8
8
|
export type UseHandleLogoutParams = {
|
|
9
|
-
removeUser: () => void;
|
|
10
9
|
clearAllWalletConnectSessions: () => void;
|
|
11
10
|
bridgeChains: ChainsToConnect[] | undefined;
|
|
12
11
|
setShowDynamicUserProfile: Dispatch<SetStateAction<boolean>>;
|
|
@@ -19,14 +19,14 @@ require('../../../../utils/constants/values.cjs');
|
|
|
19
19
|
var localStorage = require('../../../../shared/utils/classes/storage/localStorage.cjs');
|
|
20
20
|
require('../../../../shared/consts/index.cjs');
|
|
21
21
|
require('../../../../config/ApiEndpoint.cjs');
|
|
22
|
-
var session = require('../../../../data/api/session/session.cjs');
|
|
23
|
-
require('../../../../locale/locale.cjs');
|
|
24
|
-
var dynamicEvents = require('../../../../events/dynamicEvents.cjs');
|
|
25
22
|
require('@dynamic-labs/multi-wallet');
|
|
26
23
|
var getMinAuthToken = require('../../../../utils/functions/getMinAuthToken/getMinAuthToken.cjs');
|
|
27
24
|
require('react-international-phone');
|
|
28
25
|
require('viem');
|
|
29
26
|
require('viem/chains');
|
|
27
|
+
var session = require('../../../../data/api/session/session.cjs');
|
|
28
|
+
require('../../../../locale/locale.cjs');
|
|
29
|
+
var dynamicEvents = require('../../../../events/dynamicEvents.cjs');
|
|
30
30
|
var useDynamicEvents = require('../../../../utils/hooks/events/useDynamicEvents/useDynamicEvents.cjs');
|
|
31
31
|
require('../../DynamicContext.cjs');
|
|
32
32
|
require('../../../CaptchaContext/CaptchaContext.cjs');
|
|
@@ -76,12 +76,17 @@ require('../../../../widgets/DynamicWidget/components/DynamicWidgetHeader/Dynami
|
|
|
76
76
|
require('../../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
77
77
|
require('../../../../views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
78
78
|
require('../../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
79
|
+
require('zustand');
|
|
80
|
+
require('zustand/middleware');
|
|
81
|
+
var storeActions = require('../../../../store/actions/storeActions/storeActions.cjs');
|
|
82
|
+
require('zustand/react/shallow');
|
|
79
83
|
|
|
80
84
|
const clearFromLocalStorage = [
|
|
81
85
|
localStorage$1.AUTH_TOKEN,
|
|
82
86
|
localStorage$1.AUTH_MIN_TOKEN,
|
|
83
87
|
localStorage$1.WALLET_PICKER_SEARCH_KEY,
|
|
84
88
|
localStorage$1.PHANTOM_SIGNATURE_STATE,
|
|
89
|
+
localStorage$1.AUTH_ONBOARDING_TOKEN,
|
|
85
90
|
];
|
|
86
91
|
const useHandleLogout = (params) => {
|
|
87
92
|
const paramsRef = React.useRef(params);
|
|
@@ -95,7 +100,10 @@ const useHandleLogout = (params) => {
|
|
|
95
100
|
const jwt = getMinAuthToken.getMinAuthToken();
|
|
96
101
|
if (jwt && p.user) {
|
|
97
102
|
// do not await this async call - just fire and forget
|
|
98
|
-
session.revokeSession({
|
|
103
|
+
session.revokeSession({
|
|
104
|
+
environmentId: p.environmentId,
|
|
105
|
+
sessionId: p.user.sessionId,
|
|
106
|
+
});
|
|
99
107
|
}
|
|
100
108
|
p.setLegacyIsVerifying(false);
|
|
101
109
|
for (const item of clearFromLocalStorage)
|
|
@@ -120,7 +128,7 @@ const useHandleLogout = (params) => {
|
|
|
120
128
|
dynamicEvents.dynamicEvents.removeListener('embeddedWalletUpdatePasswordCompleted');
|
|
121
129
|
dynamicEvents.dynamicEvents.removeListener('embeddedWalletUpdatePasswordFailed');
|
|
122
130
|
dynamicEvents.dynamicEvents.emit('logout');
|
|
123
|
-
|
|
131
|
+
storeActions.clearStore();
|
|
124
132
|
yield Promise.all(p.walletConnectors.map((connector) => connector.endSession()));
|
|
125
133
|
yield Promise.all(p.connectedWallets.map((connectedWallet) => connectedWallet.connector.endSession()));
|
|
126
134
|
}), []);
|