@dynamic-labs/sdk-react-core 4.0.0-alpha.0 → 4.0.0-alpha.2
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 +25 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +12 -12
- package/src/lib/components/WalletInformationCard/WalletInformationCard.cjs +1 -1
- package/src/lib/components/WalletInformationCard/WalletInformationCard.js +1 -1
- package/src/lib/components/index.d.ts +0 -1
- package/src/lib/context/ConnectWithOtpContext/ConnectWithOtpProvider.cjs +5 -2
- package/src/lib/context/ConnectWithOtpContext/ConnectWithOtpProvider.js +5 -2
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.cjs +1 -70
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.d.ts +2 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.js +1 -70
- package/src/lib/context/DynamicContext/DynamicContext.cjs +10 -6
- package/src/lib/context/DynamicContext/DynamicContext.js +10 -6
- package/src/lib/context/DynamicContext/hooks/useRegisterStorageService/useRegisterStorageService.cjs +2 -0
- package/src/lib/context/DynamicContext/hooks/useRegisterStorageService/useRegisterStorageService.js +3 -1
- package/src/lib/context/DynamicContext/types/DynamicContextProps.d.ts +1 -0
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.cjs +1 -1
- package/src/lib/context/PhantomRedirectContext/useResponseHandlers.js +1 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +1 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +1 -1
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +12 -5
- package/src/lib/data/api/embeddedWallets/embeddedWallets.d.ts +4 -3
- package/src/lib/data/api/embeddedWallets/embeddedWallets.js +14 -7
- package/src/lib/data/api/transactions/blockaid.cjs +23 -0
- package/src/lib/data/api/transactions/blockaid.js +19 -0
- package/src/lib/locale/en/translation.cjs +34 -0
- package/src/lib/locale/en/translation.d.ts +34 -0
- package/src/lib/locale/en/translation.js +34 -0
- package/src/lib/shared/assets/caution-triangle.cjs +54 -0
- package/src/lib/shared/assets/caution-triangle.js +30 -0
- package/src/lib/shared/assets/exclamation-circle.cjs +54 -0
- package/src/lib/shared/assets/exclamation-circle.js +30 -0
- package/src/lib/shared/assets/exclamation.cjs +52 -0
- package/src/lib/shared/assets/exclamation.js +28 -0
- package/src/lib/shared/assets/index.d.ts +5 -0
- package/src/lib/shared/assets/warning-orange.cjs +54 -0
- package/src/lib/shared/assets/warning-orange.js +30 -0
- package/src/lib/shared/assets/warning-red.cjs +54 -0
- package/src/lib/shared/assets/warning-red.js +30 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/localStorage.cjs +6 -0
- package/src/lib/utils/constants/localStorage.d.ts +3 -0
- package/src/lib/utils/constants/localStorage.js +5 -1
- package/src/lib/utils/functions/getNewVerifiedCredentialsFromDiff/getNewVerifiedCredentialsFromDiff.cjs +11 -0
- package/src/lib/utils/functions/getNewVerifiedCredentialsFromDiff/getNewVerifiedCredentialsFromDiff.d.ts +2 -0
- package/src/lib/utils/functions/getNewVerifiedCredentialsFromDiff/getNewVerifiedCredentialsFromDiff.js +7 -0
- package/src/lib/utils/functions/getNewVerifiedCredentialsFromDiff/index.d.ts +1 -0
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +1 -1
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +1 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.cjs +9 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.js +9 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/utils.cjs +15 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/utils.d.ts +3 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/utils.js +15 -3
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.cjs +82 -26
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.d.ts +19 -2
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.js +82 -26
- package/src/lib/utils/hooks/useEndUserWarning/index.d.ts +1 -0
- package/src/lib/utils/hooks/useEndUserWarning/useEndUserWarning.cjs +39 -0
- package/src/lib/utils/hooks/useEndUserWarning/useEndUserWarning.d.ts +6 -0
- package/src/lib/utils/hooks/useEndUserWarning/useEndUserWarning.js +35 -0
- package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.cjs +5 -2
- package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.js +5 -2
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +2 -2
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.d.ts +2 -1
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +2 -2
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +7 -3
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.d.ts +2 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +7 -3
- package/src/lib/utils/hooks/useTelegramLogin/useTelegramLogin.cjs +25 -24
- package/src/lib/utils/hooks/useTelegramLogin/useTelegramLogin.d.ts +7 -1
- package/src/lib/utils/hooks/useTelegramLogin/useTelegramLogin.js +25 -24
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +4 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +4 -1
- package/src/lib/views/EmailVerification/EmailVerification.cjs +4 -1
- package/src/lib/views/EmailVerification/EmailVerification.js +4 -1
- package/src/lib/views/GlobalWalletMaliciousView/GlobalWalletMaliciousView.cjs +139 -0
- package/src/lib/views/GlobalWalletMaliciousView/GlobalWalletMaliciousView.d.ts +11 -0
- package/src/lib/views/GlobalWalletMaliciousView/GlobalWalletMaliciousView.js +134 -0
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.cjs +5 -2
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.js +5 -2
- 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/widgets/DynamicBridgeWidget/DynamicBridgeWidget.cjs +3 -3
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.d.ts +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.js +3 -3
- package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.cjs +31 -8
- package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.js +31 -8
- package/src/lib/components/TelegramAutoLogin/TelegramAutoLogin.cjs +0 -99
- package/src/lib/components/TelegramAutoLogin/TelegramAutoLogin.d.ts +0 -1
- package/src/lib/components/TelegramAutoLogin/TelegramAutoLogin.js +0 -95
- package/src/lib/components/TelegramAutoLogin/index.d.ts +0 -1
- package/src/lib/utils/constants/sessionStorage.cjs +0 -12
- package/src/lib/utils/constants/sessionStorage.js +0 -7
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
|
-
import { StorageService } from '@dynamic-labs/utils';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import '
|
|
4
|
+
import { StorageService, InvalidEmbeddedWalletSessionKeyError } from '@dynamic-labs/utils';
|
|
5
|
+
import { EmbeddedWalletVersionEnum } from '@dynamic-labs/sdk-api-core';
|
|
6
|
+
import { SECURE_ENCLAVE_WALLET_SESSION_KEYS, SECURE_ENCLAVE_WALLET_SESSION_KEYS_STORAGE_OPTIONS } from '../../constants/localStorage.js';
|
|
7
|
+
import { p256Sign, p256Keygen } from '../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/utils.js';
|
|
8
8
|
import '../../../shared/logger.js';
|
|
9
9
|
import '@dynamic-labs/iconic';
|
|
10
10
|
import '@dynamic-labs/wallet-connector-core';
|
|
@@ -20,39 +20,95 @@ import '@dynamic-labs/multi-wallet';
|
|
|
20
20
|
import 'react-international-phone';
|
|
21
21
|
import '../../../store/state/projectSettings/projectSettings.js';
|
|
22
22
|
import { registerSessionKey } from '../../../data/api/embeddedWallets/embeddedWallets.js';
|
|
23
|
-
import '../../../store/state/user/user.js';
|
|
23
|
+
import { useUser } from '../../../store/state/user/user.js';
|
|
24
24
|
import '../../../locale/locale.js';
|
|
25
|
+
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
25
26
|
|
|
26
|
-
const useEmbeddedWalletSessionKeys = (environmentId) => {
|
|
27
|
+
const useEmbeddedWalletSessionKeys = ({ environmentId, projectSettings, }) => {
|
|
28
|
+
const { user } = useUser();
|
|
29
|
+
// scenario 1: first time session register on first transaction.
|
|
30
|
+
// Keys will have been previously generated at this point in local storage but marked as not registered
|
|
31
|
+
// scenario 2: 2nd time register after expiration (key refresh)
|
|
32
|
+
// scenario 3: refresh/rerender page - session still active
|
|
33
|
+
// scenario 4: refresh/rerender page - session no longer active
|
|
27
34
|
const registerEmbeddedWalletSessionKey = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* ({ ignoreRestore = false, } = {}) {
|
|
28
35
|
// check if session keys are already stored in session storage
|
|
29
36
|
const sessionKeysSS = StorageService.getItem(SECURE_ENCLAVE_WALLET_SESSION_KEYS, SECURE_ENCLAVE_WALLET_SESSION_KEYS_STORAGE_OPTIONS);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
const decodedSessionKeys = sessionKeysSS
|
|
38
|
+
? JSON.parse(Buffer.from(sessionKeysSS, 'base64').toString())
|
|
39
|
+
: undefined;
|
|
40
|
+
if (!decodedSessionKeys) {
|
|
41
|
+
dynamicEvents.emit('triggerLogout');
|
|
42
|
+
throw new Error('Could not find session keys. Re-authentication is required to create new session keys.');
|
|
33
43
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
if (!user) {
|
|
45
|
+
throw new Error('User not found');
|
|
46
|
+
}
|
|
47
|
+
if (decodedSessionKeys.expirationDate &&
|
|
48
|
+
new Date() <= new Date(decodedSessionKeys.expirationDate) &&
|
|
49
|
+
!ignoreRestore) {
|
|
50
|
+
// scenario 3
|
|
51
|
+
return decodedSessionKeys;
|
|
52
|
+
}
|
|
53
|
+
let publicKey;
|
|
54
|
+
let privateKey;
|
|
55
|
+
let privateKeyJwk;
|
|
56
|
+
let prevSessionKeySignature = undefined;
|
|
57
|
+
if (!decodedSessionKeys.registered) {
|
|
58
|
+
// scenario 1
|
|
59
|
+
({ publicKey, privateKey, privateKeyJwk } = decodedSessionKeys);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// scenario 2 and 4
|
|
63
|
+
const { publicKey: nextPublicKey, privateKey: nextPrivateKey, privateKeyJwk: nextPrivateKeyJwk, } = yield generateSessionKey();
|
|
64
|
+
publicKey = nextPublicKey;
|
|
65
|
+
privateKey = nextPrivateKey;
|
|
66
|
+
privateKeyJwk = nextPrivateKeyJwk;
|
|
67
|
+
prevSessionKeySignature = yield p256Sign(decodedSessionKeys.privateKeyJwk, user.sessionId);
|
|
68
|
+
}
|
|
69
|
+
let resp;
|
|
70
|
+
try {
|
|
71
|
+
resp = yield registerSessionKey({
|
|
72
|
+
environmentId,
|
|
73
|
+
prevSessionKeySignature,
|
|
74
|
+
publicKey,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
if (error instanceof InvalidEmbeddedWalletSessionKeyError) {
|
|
79
|
+
// this can happen if the public key passed during initial registration
|
|
80
|
+
// does not match the root session public key that the backend expects
|
|
81
|
+
dynamicEvents.emit('triggerLogout');
|
|
82
|
+
}
|
|
83
|
+
throw error;
|
|
84
|
+
}
|
|
85
|
+
const expirationDate = new Date(resp.expiresAt * 1000);
|
|
86
|
+
StorageService.setItem(SECURE_ENCLAVE_WALLET_SESSION_KEYS, toEncodedFormat(publicKey, privateKey, privateKeyJwk, true, expirationDate), SECURE_ENCLAVE_WALLET_SESSION_KEYS_STORAGE_OPTIONS);
|
|
87
|
+
return { expirationDate, privateKey, publicKey };
|
|
40
88
|
});
|
|
41
89
|
const generateSessionKey = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
|
-
const { private: privateKey, public: publicKey } = yield p256Keygen();
|
|
90
|
+
const { private: privateKey, public: publicKey, privateJwk, } = yield p256Keygen();
|
|
43
91
|
// convert to base64 and store the session keys in session storage
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const sessionKeysBase64 = Buffer.from(sessionKeysString).toString('base64');
|
|
47
|
-
StorageService.setItem(SECURE_ENCLAVE_WALLET_SESSION_KEYS, sessionKeysBase64, SECURE_ENCLAVE_WALLET_SESSION_KEYS_STORAGE_OPTIONS);
|
|
48
|
-
return { privateKey, publicKey };
|
|
92
|
+
StorageService.setItem(SECURE_ENCLAVE_WALLET_SESSION_KEYS, toEncodedFormat(publicKey, privateKey, privateJwk, false), SECURE_ENCLAVE_WALLET_SESSION_KEYS_STORAGE_OPTIONS);
|
|
93
|
+
return { privateKey, privateKeyJwk: privateJwk, publicKey };
|
|
49
94
|
});
|
|
95
|
+
const shouldRegisterSessionKeysOnSignin = () => {
|
|
96
|
+
var _a;
|
|
97
|
+
return ((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _a === void 0 ? void 0 : _a.defaultWalletVersion) ===
|
|
98
|
+
EmbeddedWalletVersionEnum.V2;
|
|
99
|
+
};
|
|
100
|
+
const toEncodedFormat = (publicKey, privateKey, privateKeyJwk, registered, expirationDate) => {
|
|
101
|
+
const sessionKeys = {
|
|
102
|
+
expirationDate,
|
|
103
|
+
privateKey,
|
|
104
|
+
privateKeyJwk,
|
|
105
|
+
publicKey,
|
|
106
|
+
registered,
|
|
107
|
+
};
|
|
108
|
+
const sessionKeysString = JSON.stringify(sessionKeys);
|
|
109
|
+
return Buffer.from(sessionKeysString).toString('base64');
|
|
110
|
+
};
|
|
50
111
|
const removeSessionKey = useCallback(() => StorageService.removeItem(SECURE_ENCLAVE_WALLET_SESSION_KEYS, SECURE_ENCLAVE_WALLET_SESSION_KEYS_STORAGE_OPTIONS), []);
|
|
51
|
-
const shouldRegisterSessionKeysOnSignin = () => false;
|
|
52
|
-
// TODO: uncomment this once we actually implement and enforce session key chaining
|
|
53
|
-
// GVTY-2206
|
|
54
|
-
// projectSettings?.sdk?.embeddedWallets?.defaultWalletVersion ===
|
|
55
|
-
// EmbeddedWalletVersionEnum.V2;
|
|
56
112
|
return {
|
|
57
113
|
generateSessionKey,
|
|
58
114
|
registerEmbeddedWalletSessionKey,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useEndUserWarning } from './useEndUserWarning';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
8
|
+
var logger = require('../../../shared/logger.cjs');
|
|
9
|
+
require('@dynamic-labs/iconic');
|
|
10
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
11
|
+
require('react/jsx-runtime');
|
|
12
|
+
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
require('@dynamic-labs/wallet-book');
|
|
14
|
+
require('@dynamic-labs/utils');
|
|
15
|
+
require('../../constants/colors.cjs');
|
|
16
|
+
require('../../constants/values.cjs');
|
|
17
|
+
require('../../../store/state/loadingAndLifecycle.cjs');
|
|
18
|
+
require('../../../shared/consts/index.cjs');
|
|
19
|
+
|
|
20
|
+
let didLog = false;
|
|
21
|
+
const useEndUserWarning = ({ suppress = false, projectSettings, }) => {
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
var _a;
|
|
24
|
+
if (!suppress &&
|
|
25
|
+
!didLog &&
|
|
26
|
+
(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.environmentName) === sdkApiCore.EnvironmentEnum.Live) {
|
|
27
|
+
didLog = true;
|
|
28
|
+
logger.logger.info('%cWarning!', 'color: red; font-size: 32px;');
|
|
29
|
+
logger.logger.info('%cThis is a browser feature intended for developers. You are reading this message because you opened the browser console, a developer tool.\n\n%c1. Never share your tokens or sensitive information with anyone.\n2. Do not paste any code you do not fully understand.\n3. If someone instructed you to do this, it is likely a scam.\n\n%cInjecting code into your browser could result in loss of tokens or control of your account that cannot be recovered or protected.', 'font-size: 16px;', 'font-size: 12px;', 'color: red; font-size: 12px;');
|
|
30
|
+
if (((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _a === void 0 ? void 0 : _a.supportUrls) &&
|
|
31
|
+
Object.values(projectSettings.general.supportUrls).length > 0) {
|
|
32
|
+
logger.logger.info(`%cFor more information, visit ${Object.values(projectSettings.general.supportUrls)[0]}`, 'font-size: 12px;');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
|
+
}, [projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.environmentName, suppress]);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
exports.useEndUserWarning = useEndUserWarning;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { EnvironmentEnum } from '@dynamic-labs/sdk-api-core';
|
|
4
|
+
import { logger } from '../../../shared/logger.js';
|
|
5
|
+
import '@dynamic-labs/iconic';
|
|
6
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
7
|
+
import 'react/jsx-runtime';
|
|
8
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import '@dynamic-labs/wallet-book';
|
|
10
|
+
import '@dynamic-labs/utils';
|
|
11
|
+
import '../../constants/colors.js';
|
|
12
|
+
import '../../constants/values.js';
|
|
13
|
+
import '../../../store/state/loadingAndLifecycle.js';
|
|
14
|
+
import '../../../shared/consts/index.js';
|
|
15
|
+
|
|
16
|
+
let didLog = false;
|
|
17
|
+
const useEndUserWarning = ({ suppress = false, projectSettings, }) => {
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
var _a;
|
|
20
|
+
if (!suppress &&
|
|
21
|
+
!didLog &&
|
|
22
|
+
(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.environmentName) === EnvironmentEnum.Live) {
|
|
23
|
+
didLog = true;
|
|
24
|
+
logger.info('%cWarning!', 'color: red; font-size: 32px;');
|
|
25
|
+
logger.info('%cThis is a browser feature intended for developers. You are reading this message because you opened the browser console, a developer tool.\n\n%c1. Never share your tokens or sensitive information with anyone.\n2. Do not paste any code you do not fully understand.\n3. If someone instructed you to do this, it is likely a scam.\n\n%cInjecting code into your browser could result in loss of tokens or control of your account that cannot be recovered or protected.', 'font-size: 16px;', 'font-size: 12px;', 'color: red; font-size: 12px;');
|
|
26
|
+
if (((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _a === void 0 ? void 0 : _a.supportUrls) &&
|
|
27
|
+
Object.values(projectSettings.general.supportUrls).length > 0) {
|
|
28
|
+
logger.info(`%cFor more information, visit ${Object.values(projectSettings.general.supportUrls)[0]}`, 'font-size: 12px;');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
|
+
}, [projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.environmentName, suppress]);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { useEndUserWarning };
|
|
@@ -95,8 +95,11 @@ require('../../../store/state/tokenBalances.cjs');
|
|
|
95
95
|
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
96
96
|
|
|
97
97
|
const useExternalAuth = () => {
|
|
98
|
-
const { environmentId, setShowAuthFlow, setCallback } = useInternalDynamicContext.useInternalDynamicContext();
|
|
99
|
-
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys.useEmbeddedWalletSessionKeys(
|
|
98
|
+
const { environmentId, setShowAuthFlow, setCallback, projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
|
|
99
|
+
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys.useEmbeddedWalletSessionKeys({
|
|
100
|
+
environmentId,
|
|
101
|
+
projectSettings,
|
|
102
|
+
});
|
|
100
103
|
/**
|
|
101
104
|
* Uses a properly-conifigured non-Dynamic external JWT and user ID to sign-in to Dynamic.
|
|
102
105
|
* When successful, this should grant the user the ability to access Dynamic's functionality
|
|
@@ -91,8 +91,11 @@ import '../../../store/state/tokenBalances.js';
|
|
|
91
91
|
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
92
92
|
|
|
93
93
|
const useExternalAuth = () => {
|
|
94
|
-
const { environmentId, setShowAuthFlow, setCallback } = useInternalDynamicContext();
|
|
95
|
-
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys(
|
|
94
|
+
const { environmentId, setShowAuthFlow, setCallback, projectSettings } = useInternalDynamicContext();
|
|
95
|
+
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys({
|
|
96
|
+
environmentId,
|
|
97
|
+
projectSettings,
|
|
98
|
+
});
|
|
96
99
|
/**
|
|
97
100
|
* Uses a properly-conifigured non-Dynamic external JWT and user ID to sign-in to Dynamic.
|
|
98
101
|
* When successful, this should grant the user the ability to access Dynamic's functionality
|
|
@@ -92,8 +92,8 @@ require('../../../context/ConnectWithOtpContext/constants.cjs');
|
|
|
92
92
|
require('../../../context/ReinitializeContext/ReinitializeContextProvider.cjs');
|
|
93
93
|
require('../../../store/state/tokenBalances.cjs');
|
|
94
94
|
|
|
95
|
-
const useSetWalletConnectorFetchers = (walletOptions, environmentId) => {
|
|
96
|
-
const { registerEmbeddedWalletSessionKey, removeSessionKey } = useEmbeddedWalletSessionKeys.useEmbeddedWalletSessionKeys(environmentId);
|
|
95
|
+
const useSetWalletConnectorFetchers = (walletOptions, environmentId, projectSettings) => {
|
|
96
|
+
const { registerEmbeddedWalletSessionKey, removeSessionKey } = useEmbeddedWalletSessionKeys.useEmbeddedWalletSessionKeys({ environmentId, projectSettings });
|
|
97
97
|
if (!(walletOptions === null || walletOptions === void 0 ? void 0 : walletOptions.length))
|
|
98
98
|
return;
|
|
99
99
|
const { fetchAuthToken, fetchBackupCode, fetchPasscode } = getCoinbaseMPCConnectorFetchers.getCoinbaseMPCConnectorFetchers({ environmentId });
|
package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { ProjectSettings } from '@dynamic-labs/sdk-api-core';
|
|
1
2
|
import { WalletOption } from '../../../shared';
|
|
2
|
-
export declare const useSetWalletConnectorFetchers: (walletOptions: WalletOption[] | undefined, environmentId: string) => void;
|
|
3
|
+
export declare const useSetWalletConnectorFetchers: (walletOptions: WalletOption[] | undefined, environmentId: string, projectSettings: ProjectSettings | undefined) => void;
|
|
@@ -88,8 +88,8 @@ import '../../../context/ConnectWithOtpContext/constants.js';
|
|
|
88
88
|
import '../../../context/ReinitializeContext/ReinitializeContextProvider.js';
|
|
89
89
|
import '../../../store/state/tokenBalances.js';
|
|
90
90
|
|
|
91
|
-
const useSetWalletConnectorFetchers = (walletOptions, environmentId) => {
|
|
92
|
-
const { registerEmbeddedWalletSessionKey, removeSessionKey } = useEmbeddedWalletSessionKeys(environmentId);
|
|
91
|
+
const useSetWalletConnectorFetchers = (walletOptions, environmentId, projectSettings) => {
|
|
92
|
+
const { registerEmbeddedWalletSessionKey, removeSessionKey } = useEmbeddedWalletSessionKeys({ environmentId, projectSettings });
|
|
93
93
|
if (!(walletOptions === null || walletOptions === void 0 ? void 0 : walletOptions.length))
|
|
94
94
|
return;
|
|
95
95
|
const { fetchAuthToken, fetchBackupCode, fetchPasscode } = getCoinbaseMPCConnectorFetchers({ environmentId });
|
|
@@ -128,7 +128,10 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
128
128
|
const { initAuth } = useUserAuth.useUserAuth({
|
|
129
129
|
authMethod: 'social',
|
|
130
130
|
});
|
|
131
|
-
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys.useEmbeddedWalletSessionKeys(
|
|
131
|
+
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys.useEmbeddedWalletSessionKeys({
|
|
132
|
+
environmentId,
|
|
133
|
+
projectSettings,
|
|
134
|
+
});
|
|
132
135
|
const [isProcessing, setIsProcessing] = React.useState(false);
|
|
133
136
|
const [error, setError] = React.useState();
|
|
134
137
|
const clearError = () => {
|
|
@@ -283,7 +286,7 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
283
286
|
}
|
|
284
287
|
}
|
|
285
288
|
});
|
|
286
|
-
const completeConnection = (_d) => _tslib.__awaiter(void 0, [_d], void 0, function* ({ authMode, provider, state, authCode, captchaToken, verifier, telegramAuthToken, }) {
|
|
289
|
+
const completeConnection = (_d) => _tslib.__awaiter(void 0, [_d], void 0, function* ({ authMode, provider, state, authCode, captchaToken, verifier, telegramAuthToken, forceCreateUser = false, }) {
|
|
287
290
|
try {
|
|
288
291
|
let sessionPublicKey = undefined;
|
|
289
292
|
if (shouldRegisterSessionKeysOnSignin()) {
|
|
@@ -293,10 +296,11 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
293
296
|
if (authMode === 'signin') {
|
|
294
297
|
if (provider === sdkApiCore.ProviderEnum.Telegram && telegramAuthToken) {
|
|
295
298
|
const apiCall = () => oauth.telegramSignIn(environmentId, {
|
|
299
|
+
forceCreateUser,
|
|
296
300
|
sessionPublicKey,
|
|
297
301
|
telegramAuthToken,
|
|
298
302
|
});
|
|
299
|
-
yield signInAccount(provider, apiCall);
|
|
303
|
+
return yield signInAccount(provider, apiCall);
|
|
300
304
|
}
|
|
301
305
|
else if (provider === sdkApiCore.ProviderEnum.Telegram) {
|
|
302
306
|
const apiCall = () => oauth.telegramSignIn(environmentId, {
|
|
@@ -18,7 +18,7 @@ export type ConnectSocialAccountProps = {
|
|
|
18
18
|
};
|
|
19
19
|
export declare const useSocialAuth: ({ sessionTimeout, onSettled, onError, onFarcasterUrl, }: UseSocialAuthProps) => {
|
|
20
20
|
readonly checkValidProvider: (provider: ProviderEnum, authMode: SocialAuthMode) => boolean;
|
|
21
|
-
readonly completeConnection: ({ authMode, provider, state, authCode, captchaToken, verifier, telegramAuthToken, }: {
|
|
21
|
+
readonly completeConnection: ({ authMode, provider, state, authCode, captchaToken, verifier, telegramAuthToken, forceCreateUser, }: {
|
|
22
22
|
authMode: SocialAuthMode;
|
|
23
23
|
provider: ProviderEnum;
|
|
24
24
|
state: string;
|
|
@@ -26,6 +26,7 @@ export declare const useSocialAuth: ({ sessionTimeout, onSettled, onError, onFar
|
|
|
26
26
|
authCode?: string | undefined;
|
|
27
27
|
verifier?: string | undefined;
|
|
28
28
|
telegramAuthToken?: string | undefined;
|
|
29
|
+
forceCreateUser?: boolean | undefined;
|
|
29
30
|
}) => Promise<void>;
|
|
30
31
|
readonly connectSocialAccount: ({ authMode, provider, validator, captchaToken, redirectUrl, telegramAuthToken, }: ConnectSocialAccountProps) => Promise<void>;
|
|
31
32
|
readonly error: SocialOAuthError | undefined;
|
|
@@ -124,7 +124,10 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
124
124
|
const { initAuth: initAuth$1 } = useUserAuth({
|
|
125
125
|
authMethod: 'social',
|
|
126
126
|
});
|
|
127
|
-
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys(
|
|
127
|
+
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys({
|
|
128
|
+
environmentId,
|
|
129
|
+
projectSettings,
|
|
130
|
+
});
|
|
128
131
|
const [isProcessing, setIsProcessing] = useState(false);
|
|
129
132
|
const [error, setError] = useState();
|
|
130
133
|
const clearError = () => {
|
|
@@ -279,7 +282,7 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
279
282
|
}
|
|
280
283
|
}
|
|
281
284
|
});
|
|
282
|
-
const completeConnection = (_d) => __awaiter(void 0, [_d], void 0, function* ({ authMode, provider, state, authCode, captchaToken, verifier, telegramAuthToken, }) {
|
|
285
|
+
const completeConnection = (_d) => __awaiter(void 0, [_d], void 0, function* ({ authMode, provider, state, authCode, captchaToken, verifier, telegramAuthToken, forceCreateUser = false, }) {
|
|
283
286
|
try {
|
|
284
287
|
let sessionPublicKey = undefined;
|
|
285
288
|
if (shouldRegisterSessionKeysOnSignin()) {
|
|
@@ -289,10 +292,11 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
289
292
|
if (authMode === 'signin') {
|
|
290
293
|
if (provider === ProviderEnum.Telegram && telegramAuthToken) {
|
|
291
294
|
const apiCall = () => telegramSignIn(environmentId, {
|
|
295
|
+
forceCreateUser,
|
|
292
296
|
sessionPublicKey,
|
|
293
297
|
telegramAuthToken,
|
|
294
298
|
});
|
|
295
|
-
yield signInAccount(provider, apiCall);
|
|
299
|
+
return yield signInAccount(provider, apiCall);
|
|
296
300
|
}
|
|
297
301
|
else if (provider === ProviderEnum.Telegram) {
|
|
298
302
|
const apiCall = () => telegramSignIn(environmentId, {
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
|
-
var React = require('react');
|
|
8
7
|
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
9
8
|
require('../../constants/values.cjs');
|
|
10
9
|
require('@dynamic-labs/utils');
|
|
@@ -16,6 +15,7 @@ require('@dynamic-labs/iconic');
|
|
|
16
15
|
require('@dynamic-labs/wallet-connector-core');
|
|
17
16
|
require('react/jsx-runtime');
|
|
18
17
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
18
|
+
require('react');
|
|
19
19
|
require('@dynamic-labs/wallet-book');
|
|
20
20
|
require('../../../store/state/loadingAndLifecycle.cjs');
|
|
21
21
|
require('../../../shared/consts/index.cjs');
|
|
@@ -99,30 +99,31 @@ const useTelegramLogin = () => {
|
|
|
99
99
|
const { completeConnection } = useSocialAuth.useSocialAuth({
|
|
100
100
|
sessionTimeout: 20000,
|
|
101
101
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
});
|
|
102
|
+
const telegramSignIn = (...args_1) => _tslib.__awaiter(void 0, [...args_1], void 0, function* ({ forceCreateUser = false, } = {}) {
|
|
103
|
+
// in non-browser environments like Node.js
|
|
104
|
+
// or during server-side rendering (e.g., with frameworks like Next.js).
|
|
105
|
+
if (typeof window === 'undefined') {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const search = new URLSearchParams(window.location.search);
|
|
109
|
+
const telegramAuthToken = search.get('telegramAuthToken');
|
|
110
|
+
if (!isProviderEnabled.isProviderEnabled(providers, sdkApiCore.ProviderEnum.Telegram) ||
|
|
111
|
+
user ||
|
|
112
|
+
!telegramAuthToken ||
|
|
113
|
+
!sdkHasLoaded) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
yield completeConnection({
|
|
117
|
+
authMode: 'signin',
|
|
118
|
+
forceCreateUser,
|
|
119
|
+
provider: sdkApiCore.ProviderEnum.Telegram,
|
|
120
|
+
state: '',
|
|
121
|
+
telegramAuthToken,
|
|
123
122
|
});
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
});
|
|
124
|
+
return {
|
|
125
|
+
telegramSignIn,
|
|
126
|
+
};
|
|
126
127
|
};
|
|
127
128
|
|
|
128
129
|
exports.useTelegramLogin = useTelegramLogin;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
3
|
import { ProviderEnum } from '@dynamic-labs/sdk-api-core';
|
|
5
4
|
import '../../constants/values.js';
|
|
6
5
|
import '@dynamic-labs/utils';
|
|
@@ -12,6 +11,7 @@ import '@dynamic-labs/iconic';
|
|
|
12
11
|
import '@dynamic-labs/wallet-connector-core';
|
|
13
12
|
import 'react/jsx-runtime';
|
|
14
13
|
import '../../../context/ViewContext/ViewContext.js';
|
|
14
|
+
import 'react';
|
|
15
15
|
import '@dynamic-labs/wallet-book';
|
|
16
16
|
import '../../../store/state/loadingAndLifecycle.js';
|
|
17
17
|
import '../../../shared/consts/index.js';
|
|
@@ -95,30 +95,31 @@ const useTelegramLogin = () => {
|
|
|
95
95
|
const { completeConnection } = useSocialAuth({
|
|
96
96
|
sessionTimeout: 20000,
|
|
97
97
|
});
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
});
|
|
98
|
+
const telegramSignIn = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* ({ forceCreateUser = false, } = {}) {
|
|
99
|
+
// in non-browser environments like Node.js
|
|
100
|
+
// or during server-side rendering (e.g., with frameworks like Next.js).
|
|
101
|
+
if (typeof window === 'undefined') {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const search = new URLSearchParams(window.location.search);
|
|
105
|
+
const telegramAuthToken = search.get('telegramAuthToken');
|
|
106
|
+
if (!isProviderEnabled(providers, ProviderEnum.Telegram) ||
|
|
107
|
+
user ||
|
|
108
|
+
!telegramAuthToken ||
|
|
109
|
+
!sdkHasLoaded) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
yield completeConnection({
|
|
113
|
+
authMode: 'signin',
|
|
114
|
+
forceCreateUser,
|
|
115
|
+
provider: ProviderEnum.Telegram,
|
|
116
|
+
state: '',
|
|
117
|
+
telegramAuthToken,
|
|
119
118
|
});
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
});
|
|
120
|
+
return {
|
|
121
|
+
telegramSignIn,
|
|
122
|
+
};
|
|
122
123
|
};
|
|
123
124
|
|
|
124
125
|
export { useTelegramLogin };
|
|
@@ -110,7 +110,10 @@ const useVerifyWallet = ({ consumeNonce, displaySiweStatement, environmentId, pr
|
|
|
110
110
|
const { multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setShowAuthFlow, setPrimaryWalletId, siweStatement, connectedWallets, authMode, user, setAuthMode, removeConnectedWalletsInfo, events, primaryWallet, enableConnectOnlyFallback, selectedWalletConnector, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
111
111
|
const { addedWalletsIds } = UserWalletsContext.useInternalUserWallets();
|
|
112
112
|
const { initAuth } = useUserAuth.useUserAuth({ authMethod: 'wallet' });
|
|
113
|
-
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys.useEmbeddedWalletSessionKeys(
|
|
113
|
+
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys.useEmbeddedWalletSessionKeys({
|
|
114
|
+
environmentId,
|
|
115
|
+
projectSettings,
|
|
116
|
+
});
|
|
114
117
|
// If the user is not already logged it means that we only need to verify
|
|
115
118
|
// We need this boolean to distinguish between logic for verify or linking.
|
|
116
119
|
const verifyOnly = !user;
|
|
@@ -106,7 +106,10 @@ const useVerifyWallet = ({ consumeNonce, displaySiweStatement, environmentId, pr
|
|
|
106
106
|
const { multiWalletWidgetState, debugError, multiWallet: multiWalletEnabled, appName, primaryWalletId, setShowAuthFlow, setPrimaryWalletId, siweStatement, connectedWallets, authMode, user, setAuthMode, removeConnectedWalletsInfo, events, primaryWallet, enableConnectOnlyFallback, selectedWalletConnector, } = useInternalDynamicContext();
|
|
107
107
|
const { addedWalletsIds } = useInternalUserWallets();
|
|
108
108
|
const { initAuth } = useUserAuth({ authMethod: 'wallet' });
|
|
109
|
-
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys(
|
|
109
|
+
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys({
|
|
110
|
+
environmentId,
|
|
111
|
+
projectSettings,
|
|
112
|
+
});
|
|
110
113
|
// If the user is not already logged it means that we only need to verify
|
|
111
114
|
// We need this boolean to distinguish between logic for verify or linking.
|
|
112
115
|
const verifyOnly = !user;
|
|
@@ -140,7 +140,10 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
140
140
|
const { initAuth, completeAuth, cancelAuth } = useUserAuth.useUserAuth({
|
|
141
141
|
authMethod: 'email',
|
|
142
142
|
});
|
|
143
|
-
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys.useEmbeddedWalletSessionKeys(
|
|
143
|
+
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys.useEmbeddedWalletSessionKeys({
|
|
144
|
+
environmentId,
|
|
145
|
+
projectSettings,
|
|
146
|
+
});
|
|
144
147
|
// When true, causes the component to call emailVerificationX callback on unmount
|
|
145
148
|
const callCallbackOnUnmount = React.useRef(true);
|
|
146
149
|
useOnUnmount.useOnUnmount(() => {
|
|
@@ -136,7 +136,10 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
136
136
|
const { initAuth, completeAuth, cancelAuth } = useUserAuth({
|
|
137
137
|
authMethod: 'email',
|
|
138
138
|
});
|
|
139
|
-
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys(
|
|
139
|
+
const { generateSessionKey, shouldRegisterSessionKeysOnSignin } = useEmbeddedWalletSessionKeys({
|
|
140
|
+
environmentId,
|
|
141
|
+
projectSettings,
|
|
142
|
+
});
|
|
140
143
|
// When true, causes the component to call emailVerificationX callback on unmount
|
|
141
144
|
const callCallbackOnUnmount = useRef(true);
|
|
142
145
|
useOnUnmount(() => {
|