@dynamic-labs/sdk-react-core 4.46.3 → 4.47.1
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 +21 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/index.cjs +2 -2
- package/src/index.js +1 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.cjs +2 -0
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.js +2 -0
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.cjs +2 -0
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.js +2 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +2 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +2 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +2 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +2 -0
- package/src/lib/shared/assets/backup-waas.cjs +52 -0
- package/src/lib/shared/assets/backup-waas.js +28 -0
- package/src/lib/shared/assets/backupArrow.cjs +54 -0
- package/src/lib/shared/assets/backupArrow.js +30 -0
- package/src/lib/shared/assets/filled-question-mark.cjs +52 -0
- package/src/lib/shared/assets/filled-question-mark.js +28 -0
- package/src/lib/shared/assets/google-drive.cjs +75 -0
- package/src/lib/shared/assets/google-drive.js +51 -0
- package/src/lib/shared/assets/index.d.ts +4 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/clientSessionKeys/getClientSessionKeys.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +2 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +2 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +2 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +2 -0
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +2 -0
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +2 -0
- package/src/lib/utils/hooks/useClientSessionKeys/useClientSessionKeys.cjs +0 -6
- package/src/lib/utils/hooks/useClientSessionKeys/useClientSessionKeys.js +1 -7
- package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.cjs +2 -0
- package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.js +2 -0
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +3 -1
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.d.ts +5 -1
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +3 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +6 -2
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.d.ts +1 -0
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +6 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +2 -0
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +2 -0
- package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -0
- package/src/lib/views/EmailVerification/EmailVerification.js +2 -0
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +1 -0
- package/src/lib/views/SendBalanceView/SendBalanceView.js +1 -0
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.cjs +2 -0
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.cjs +4 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.js +4 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/EmbeddedWalletExportSection/EmbeddedWalletExportSection.cjs +15 -5
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/EmbeddedWalletExportSection/EmbeddedWalletExportSection.js +15 -5
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupInfoView.cjs +36 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupInfoView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupInfoView.js +32 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupView.cjs +191 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/WaasBackupView.js +187 -0
- package/src/lib/widgets/DynamicWidget/views/WaasBackupView/index.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/index.d.ts +2 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { StorageService, tracing } from '@dynamic-labs/utils';
|
|
4
4
|
import { CLIENT_SESSION_KEYS, CLIENT_SESSION_KEYS_STORAGE_OPTIONS } from '../../constants/sessionStorage.js';
|
|
5
|
-
import {
|
|
5
|
+
import { p256Keygen, toEncodedFormat, p256Sign } from '../keyService/keyService.js';
|
|
6
6
|
import '@dynamic-labs/iconic';
|
|
7
7
|
import '@dynamic-labs/wallet-connector-core';
|
|
8
8
|
import 'react';
|
|
@@ -35,6 +35,7 @@ require('@dynamic-labs/locale');
|
|
|
35
35
|
require('../../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
36
36
|
require('../../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
37
37
|
require('../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
38
|
+
var getClientSessionKeys = require('../../../functions/clientSessionKeys/getClientSessionKeys.cjs');
|
|
38
39
|
var useHandleWalletsToConnect = require('../../useHandleWalletsToConnect/useHandleWalletsToConnect.cjs');
|
|
39
40
|
var useVerifyWallet = require('../../useVerifyWallet/useVerifyWallet.cjs');
|
|
40
41
|
var showPendingConnectView = require('../helpers/showPendingConnectView.cjs');
|
|
@@ -130,6 +131,7 @@ const useConnectAndSign = ({ shouldUpdateWallets = true, shouldCallCallback = tr
|
|
|
130
131
|
else {
|
|
131
132
|
walletUiUtils.disabledConfirmationOnce();
|
|
132
133
|
}
|
|
134
|
+
yield getClientSessionKeys.generateClientSessionKeys();
|
|
133
135
|
yield verifyWallet({
|
|
134
136
|
captchaToken,
|
|
135
137
|
publicWalletAddress,
|
|
@@ -31,6 +31,7 @@ import '@dynamic-labs/locale';
|
|
|
31
31
|
import '../../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
32
32
|
import '../../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
33
33
|
import '../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
34
|
+
import { generateClientSessionKeys } from '../../../functions/clientSessionKeys/getClientSessionKeys.js';
|
|
34
35
|
import { useHandleWalletsToConnect } from '../../useHandleWalletsToConnect/useHandleWalletsToConnect.js';
|
|
35
36
|
import { useVerifyWallet } from '../../useVerifyWallet/useVerifyWallet.js';
|
|
36
37
|
import { showPendingConnectView } from '../helpers/showPendingConnectView.js';
|
|
@@ -126,6 +127,7 @@ const useConnectAndSign = ({ shouldUpdateWallets = true, shouldCallCallback = tr
|
|
|
126
127
|
else {
|
|
127
128
|
walletUiUtils.disabledConfirmationOnce();
|
|
128
129
|
}
|
|
130
|
+
yield generateClientSessionKeys();
|
|
129
131
|
yield verifyWallet({
|
|
130
132
|
captchaToken,
|
|
131
133
|
publicWalletAddress,
|
|
@@ -35,6 +35,7 @@ require('@dynamic-labs/locale');
|
|
|
35
35
|
require('../../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
36
36
|
require('../../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
37
37
|
require('../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
38
|
+
var getClientSessionKeys = require('../../../functions/clientSessionKeys/getClientSessionKeys.cjs');
|
|
38
39
|
var useHandleWalletsToConnect = require('../../useHandleWalletsToConnect/useHandleWalletsToConnect.cjs');
|
|
39
40
|
var useVerifyWallet = require('../../useVerifyWallet/useVerifyWallet.cjs');
|
|
40
41
|
var showPendingConnectView = require('../helpers/showPendingConnectView.cjs');
|
|
@@ -188,6 +189,7 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
188
189
|
}
|
|
189
190
|
return pushView('network-not-supported');
|
|
190
191
|
}
|
|
192
|
+
yield getClientSessionKeys.generateClientSessionKeys();
|
|
191
193
|
yield verifyWallet({
|
|
192
194
|
captchaToken: getCaptchaToken(),
|
|
193
195
|
publicWalletAddress: connectionResult.address,
|
|
@@ -31,6 +31,7 @@ import '@dynamic-labs/locale';
|
|
|
31
31
|
import '../../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
32
32
|
import '../../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
33
33
|
import '../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
34
|
+
import { generateClientSessionKeys } from '../../../functions/clientSessionKeys/getClientSessionKeys.js';
|
|
34
35
|
import { useHandleWalletsToConnect } from '../../useHandleWalletsToConnect/useHandleWalletsToConnect.js';
|
|
35
36
|
import { useVerifyWallet } from '../../useVerifyWallet/useVerifyWallet.js';
|
|
36
37
|
import { showPendingConnectView } from '../helpers/showPendingConnectView.js';
|
|
@@ -184,6 +185,7 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
184
185
|
}
|
|
185
186
|
return pushView('network-not-supported');
|
|
186
187
|
}
|
|
188
|
+
yield generateClientSessionKeys();
|
|
187
189
|
yield verifyWallet({
|
|
188
190
|
captchaToken: getCaptchaToken(),
|
|
189
191
|
publicWalletAddress: connectionResult.address,
|
package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs
CHANGED
|
@@ -32,6 +32,7 @@ require('@dynamic-labs/locale');
|
|
|
32
32
|
require('../../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
33
33
|
require('../../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
34
34
|
require('../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
35
|
+
var getClientSessionKeys = require('../../../functions/clientSessionKeys/getClientSessionKeys.cjs');
|
|
35
36
|
var useVerifyWallet = require('../../useVerifyWallet/useVerifyWallet.cjs');
|
|
36
37
|
require('../../../../store/state/authMode/authMode.cjs');
|
|
37
38
|
require('../../../../context/VerificationContext/VerificationContext.cjs');
|
|
@@ -136,6 +137,7 @@ const useSignConnectOnlyUser = () => {
|
|
|
136
137
|
if (!(connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.address)) {
|
|
137
138
|
return;
|
|
138
139
|
}
|
|
140
|
+
yield getClientSessionKeys.generateClientSessionKeys();
|
|
139
141
|
yield verifyWallet({
|
|
140
142
|
captchaToken: getCaptchaToken(),
|
|
141
143
|
publicWalletAddress: connectionResult.address,
|
package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js
CHANGED
|
@@ -28,6 +28,7 @@ import '@dynamic-labs/locale';
|
|
|
28
28
|
import '../../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
29
29
|
import '../../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
30
30
|
import '../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
31
|
+
import { generateClientSessionKeys } from '../../../functions/clientSessionKeys/getClientSessionKeys.js';
|
|
31
32
|
import { useVerifyWallet } from '../../useVerifyWallet/useVerifyWallet.js';
|
|
32
33
|
import '../../../../store/state/authMode/authMode.js';
|
|
33
34
|
import '../../../../context/VerificationContext/VerificationContext.js';
|
|
@@ -132,6 +133,7 @@ const useSignConnectOnlyUser = () => {
|
|
|
132
133
|
if (!(connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.address)) {
|
|
133
134
|
return;
|
|
134
135
|
}
|
|
136
|
+
yield generateClientSessionKeys();
|
|
135
137
|
yield verifyWallet({
|
|
136
138
|
captchaToken: getCaptchaToken(),
|
|
137
139
|
publicWalletAddress: connectionResult.address,
|
|
@@ -35,12 +35,6 @@ var usePromise = require('../usePromise/usePromise.cjs');
|
|
|
35
35
|
const useClientSessionKeys = () => {
|
|
36
36
|
const user = useOnboardingCompleteUser.useOnboardingCompleteUser();
|
|
37
37
|
const sessionPublicKey = getClientSessionKeys.getClientSessionPublicKey();
|
|
38
|
-
usePromise.usePromise(getClientSessionKeys.generateClientSessionKeys, {
|
|
39
|
-
deps: [sessionPublicKey],
|
|
40
|
-
enabled: !sessionPublicKey,
|
|
41
|
-
initialData: undefined,
|
|
42
|
-
retries: 2,
|
|
43
|
-
});
|
|
44
38
|
const getSignedSessionId = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
45
39
|
if (!(user === null || user === void 0 ? void 0 : user.sessionId) || !sessionPublicKey) {
|
|
46
40
|
throw new Error('Session ID and public key are required');
|
|
@@ -23,7 +23,7 @@ import '@dynamic-labs/locale';
|
|
|
23
23
|
import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
24
24
|
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
25
25
|
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
26
|
-
import { getClientSessionPublicKey, getClientSessionSignature
|
|
26
|
+
import { getClientSessionPublicKey, getClientSessionSignature } from '../../functions/clientSessionKeys/getClientSessionKeys.js';
|
|
27
27
|
import '../../../events/dynamicEvents.js';
|
|
28
28
|
import { useOnboardingCompleteUser } from '../../../client/extension/user/useOnboardingCompleteUser/useOnboardingCompleteUser.js';
|
|
29
29
|
import { usePromise } from '../usePromise/usePromise.js';
|
|
@@ -31,12 +31,6 @@ import { usePromise } from '../usePromise/usePromise.js';
|
|
|
31
31
|
const useClientSessionKeys = () => {
|
|
32
32
|
const user = useOnboardingCompleteUser();
|
|
33
33
|
const sessionPublicKey = getClientSessionPublicKey();
|
|
34
|
-
usePromise(generateClientSessionKeys, {
|
|
35
|
-
deps: [sessionPublicKey],
|
|
36
|
-
enabled: !sessionPublicKey,
|
|
37
|
-
initialData: undefined,
|
|
38
|
-
retries: 2,
|
|
39
|
-
});
|
|
40
34
|
const getSignedSessionId = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
35
|
if (!(user === null || user === void 0 ? void 0 : user.sessionId) || !sessionPublicKey) {
|
|
42
36
|
throw new Error('Session ID and public key are required');
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var client = require('@dynamic-labs-sdk/client');
|
|
9
|
+
var getClientSessionKeys = require('../../functions/clientSessionKeys/getClientSessionKeys.cjs');
|
|
9
10
|
require('@dynamic-labs/utils');
|
|
10
11
|
require('@dynamic-labs/sdk-api-core');
|
|
11
12
|
require('@dynamic-labs-sdk/client/core');
|
|
@@ -127,6 +128,7 @@ const useExternalAuth = () => {
|
|
|
127
128
|
const sessionPublicKey = shouldRegisterSessionKeysOnSignin()
|
|
128
129
|
? (yield generateSessionKey()).publicKey
|
|
129
130
|
: undefined;
|
|
131
|
+
yield getClientSessionKeys.generateClientSessionKeys();
|
|
130
132
|
const response = yield client.signInWithExternalJwt({
|
|
131
133
|
externalJwt,
|
|
132
134
|
sessionPublicKey,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { useCallback, useMemo } from 'react';
|
|
4
4
|
import { signInWithExternalJwt } from '@dynamic-labs-sdk/client';
|
|
5
|
+
import { generateClientSessionKeys } from '../../functions/clientSessionKeys/getClientSessionKeys.js';
|
|
5
6
|
import '@dynamic-labs/utils';
|
|
6
7
|
import '@dynamic-labs/sdk-api-core';
|
|
7
8
|
import '@dynamic-labs-sdk/client/core';
|
|
@@ -123,6 +124,7 @@ const useExternalAuth = () => {
|
|
|
123
124
|
const sessionPublicKey = shouldRegisterSessionKeysOnSignin()
|
|
124
125
|
? (yield generateSessionKey()).publicKey
|
|
125
126
|
: undefined;
|
|
127
|
+
yield generateClientSessionKeys();
|
|
126
128
|
const response = yield signInWithExternalJwt({
|
|
127
129
|
externalJwt,
|
|
128
130
|
sessionPublicKey,
|
|
@@ -159,7 +159,8 @@ const useSocialAccounts = () => {
|
|
|
159
159
|
}
|
|
160
160
|
return true;
|
|
161
161
|
}, [handleError, projectSettings]);
|
|
162
|
-
const linkSocialAccount = React.useCallback((provider_1, ...args_1) => _tslib.__awaiter(void 0, [provider_1, ...args_1], void 0, function* (provider, { redirectUrl, showWidgetAfterConnection, triggerFundFromExchangeOnSuccess, payingWithDynamic, } = {
|
|
162
|
+
const linkSocialAccount = React.useCallback((provider_1, ...args_1) => _tslib.__awaiter(void 0, [provider_1, ...args_1], void 0, function* (provider, { forcePopup, redirectUrl, showWidgetAfterConnection, triggerFundFromExchangeOnSuccess, payingWithDynamic, } = {
|
|
163
|
+
forcePopup: false,
|
|
163
164
|
payingWithDynamic: undefined,
|
|
164
165
|
redirectUrl: undefined,
|
|
165
166
|
showWidgetAfterConnection: false,
|
|
@@ -169,6 +170,7 @@ const useSocialAccounts = () => {
|
|
|
169
170
|
try {
|
|
170
171
|
yield connectSocialAccount({
|
|
171
172
|
authMode: 'link',
|
|
173
|
+
forcePopup,
|
|
172
174
|
payingWithDynamic,
|
|
173
175
|
provider,
|
|
174
176
|
redirectUrl,
|
|
@@ -10,6 +10,10 @@ type ConnectSocialProps = {
|
|
|
10
10
|
* Whether to show the widget after a connection is made
|
|
11
11
|
*/
|
|
12
12
|
showWidgetAfterConnection?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Forces popup strategy instead of redirect
|
|
15
|
+
*/
|
|
16
|
+
forcePopup?: boolean;
|
|
13
17
|
/** Exchange to be funded */
|
|
14
18
|
triggerFundFromExchangeOnSuccess?: ExchangeKeyEnum;
|
|
15
19
|
/**
|
|
@@ -25,7 +29,7 @@ export declare const useSocialAccounts: () => {
|
|
|
25
29
|
readonly isLinked: (provider: ProviderEnum) => boolean;
|
|
26
30
|
readonly isProcessing: boolean;
|
|
27
31
|
readonly isProcessingForProvider: (provider: ProviderEnum) => boolean;
|
|
28
|
-
readonly linkSocialAccount: (provider: ProviderEnum, { redirectUrl, showWidgetAfterConnection, triggerFundFromExchangeOnSuccess, payingWithDynamic, }?: ConnectSocialProps) => Promise<void>;
|
|
32
|
+
readonly linkSocialAccount: (provider: ProviderEnum, { forcePopup, redirectUrl, showWidgetAfterConnection, triggerFundFromExchangeOnSuccess, payingWithDynamic, }?: ConnectSocialProps) => Promise<void>;
|
|
29
33
|
readonly signInWithSocialAccount: (provider: ProviderEnum, { redirectUrl, payingWithDynamic, showWidgetAfterConnection, triggerFundFromExchangeOnSuccess, }?: ConnectSocialProps) => Promise<void>;
|
|
30
34
|
readonly unlinkSocialAccount: (provider: ProviderEnum, verifiedCredentialId?: string) => Promise<void>;
|
|
31
35
|
};
|
|
@@ -155,7 +155,8 @@ const useSocialAccounts = () => {
|
|
|
155
155
|
}
|
|
156
156
|
return true;
|
|
157
157
|
}, [handleError, projectSettings]);
|
|
158
|
-
const linkSocialAccount = useCallback((provider_1, ...args_1) => __awaiter(void 0, [provider_1, ...args_1], void 0, function* (provider, { redirectUrl, showWidgetAfterConnection, triggerFundFromExchangeOnSuccess, payingWithDynamic, } = {
|
|
158
|
+
const linkSocialAccount = useCallback((provider_1, ...args_1) => __awaiter(void 0, [provider_1, ...args_1], void 0, function* (provider, { forcePopup, redirectUrl, showWidgetAfterConnection, triggerFundFromExchangeOnSuccess, payingWithDynamic, } = {
|
|
159
|
+
forcePopup: false,
|
|
159
160
|
payingWithDynamic: undefined,
|
|
160
161
|
redirectUrl: undefined,
|
|
161
162
|
showWidgetAfterConnection: false,
|
|
@@ -165,6 +166,7 @@ const useSocialAccounts = () => {
|
|
|
165
166
|
try {
|
|
166
167
|
yield connectSocialAccount({
|
|
167
168
|
authMode: 'link',
|
|
169
|
+
forcePopup,
|
|
168
170
|
payingWithDynamic,
|
|
169
171
|
provider,
|
|
170
172
|
redirectUrl,
|
|
@@ -40,6 +40,7 @@ require('@dynamic-labs/locale');
|
|
|
40
40
|
require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
41
41
|
require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
42
42
|
require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
43
|
+
var getClientSessionKeys = require('../../functions/clientSessionKeys/getClientSessionKeys.cjs');
|
|
43
44
|
require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
44
45
|
require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
45
46
|
require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
@@ -224,6 +225,7 @@ const useSocialAuth = ({ onSettled, onError, onFarcasterUrl, }) => {
|
|
|
224
225
|
}));
|
|
225
226
|
}
|
|
226
227
|
if (authMode === 'signin') {
|
|
228
|
+
yield getClientSessionKeys.generateClientSessionKeys();
|
|
227
229
|
if (provider === sdkApiCore.ProviderEnum.Telegram && telegramAuthToken) {
|
|
228
230
|
const apiCall = () => oauth.telegramSignIn(environmentId, {
|
|
229
231
|
captchaToken,
|
|
@@ -338,6 +340,7 @@ const useSocialAuth = ({ onSettled, onError, onFarcasterUrl, }) => {
|
|
|
338
340
|
const keypair = yield generateSessionKey();
|
|
339
341
|
sessionPublicKey = keypair.publicKey;
|
|
340
342
|
}
|
|
343
|
+
yield getClientSessionKeys.generateClientSessionKeys();
|
|
341
344
|
const apiCall = () => oauth.farcasterSignIn(environmentId, {
|
|
342
345
|
address,
|
|
343
346
|
captchaToken,
|
|
@@ -376,7 +379,7 @@ const useSocialAuth = ({ onSettled, onError, onFarcasterUrl, }) => {
|
|
|
376
379
|
shouldRegisterSessionKeysOnSignin,
|
|
377
380
|
signInAccount,
|
|
378
381
|
]);
|
|
379
|
-
const connectSocialAccount = React.useCallback((_d) => _tslib.__awaiter(void 0, [_d], void 0, function* ({ authMode, provider, validator, captchaToken, isHeadlessSocialSignIn, payingWithDynamic, triggerFundFromExchangeOnSuccess, redirectUrl, telegramAuthToken, showWidgetAfterConnection, ssoProviderId, }) {
|
|
382
|
+
const connectSocialAccount = React.useCallback((_d) => _tslib.__awaiter(void 0, [_d], void 0, function* ({ authMode, provider, validator, captchaToken, isHeadlessSocialSignIn, payingWithDynamic, triggerFundFromExchangeOnSuccess, redirectUrl, telegramAuthToken, showWidgetAfterConnection, forcePopup, ssoProviderId, }) {
|
|
380
383
|
var _e, _f;
|
|
381
384
|
clearError();
|
|
382
385
|
setIsProcessing(true);
|
|
@@ -432,6 +435,7 @@ const useSocialAuth = ({ onSettled, onError, onFarcasterUrl, }) => {
|
|
|
432
435
|
}
|
|
433
436
|
const isMobile = utils.isMobile();
|
|
434
437
|
try {
|
|
438
|
+
const effectiveStrategy = forcePopup ? 'popup' : strategy;
|
|
435
439
|
const authCode = yield utils.Oauth2Service.getOauthCode({
|
|
436
440
|
apiProvider: getProviderByType.getProviderByType((_f = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _f !== void 0 ? _f : [], provider),
|
|
437
441
|
getOAuthResultFromApi: () => oauth.getOAuthResult(environmentId, provider, {
|
|
@@ -450,7 +454,7 @@ const useSocialAuth = ({ onSettled, onError, onFarcasterUrl, }) => {
|
|
|
450
454
|
redirectUrl: redirectUrl !== null && redirectUrl !== void 0 ? redirectUrl : defaultRedirectUrl,
|
|
451
455
|
setIsProcessing,
|
|
452
456
|
state,
|
|
453
|
-
strategy,
|
|
457
|
+
strategy: effectiveStrategy,
|
|
454
458
|
});
|
|
455
459
|
yield completeConnection({
|
|
456
460
|
authCode,
|
|
@@ -16,6 +16,7 @@ export type ConnectSocialAccountProps = {
|
|
|
16
16
|
redirectUrl?: string;
|
|
17
17
|
telegramAuthToken?: string;
|
|
18
18
|
showWidgetAfterConnection?: boolean;
|
|
19
|
+
forcePopup?: boolean;
|
|
19
20
|
triggerFundFromExchangeOnSuccess?: ExchangeKeyEnum;
|
|
20
21
|
payingWithDynamic?: PayWithDynamicProps;
|
|
21
22
|
/** marks the flow as initiated by headless sign-in API */
|
|
@@ -36,6 +36,7 @@ import '@dynamic-labs/locale';
|
|
|
36
36
|
import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
37
37
|
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
38
38
|
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
39
|
+
import { generateClientSessionKeys } from '../../functions/clientSessionKeys/getClientSessionKeys.js';
|
|
39
40
|
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
40
41
|
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
41
42
|
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
@@ -220,6 +221,7 @@ const useSocialAuth = ({ onSettled, onError, onFarcasterUrl, }) => {
|
|
|
220
221
|
}));
|
|
221
222
|
}
|
|
222
223
|
if (authMode === 'signin') {
|
|
224
|
+
yield generateClientSessionKeys();
|
|
223
225
|
if (provider === ProviderEnum.Telegram && telegramAuthToken) {
|
|
224
226
|
const apiCall = () => telegramSignIn(environmentId, {
|
|
225
227
|
captchaToken,
|
|
@@ -334,6 +336,7 @@ const useSocialAuth = ({ onSettled, onError, onFarcasterUrl, }) => {
|
|
|
334
336
|
const keypair = yield generateSessionKey();
|
|
335
337
|
sessionPublicKey = keypair.publicKey;
|
|
336
338
|
}
|
|
339
|
+
yield generateClientSessionKeys();
|
|
337
340
|
const apiCall = () => farcasterSignIn(environmentId, {
|
|
338
341
|
address,
|
|
339
342
|
captchaToken,
|
|
@@ -372,7 +375,7 @@ const useSocialAuth = ({ onSettled, onError, onFarcasterUrl, }) => {
|
|
|
372
375
|
shouldRegisterSessionKeysOnSignin,
|
|
373
376
|
signInAccount,
|
|
374
377
|
]);
|
|
375
|
-
const connectSocialAccount = useCallback((_d) => __awaiter(void 0, [_d], void 0, function* ({ authMode, provider, validator, captchaToken, isHeadlessSocialSignIn, payingWithDynamic, triggerFundFromExchangeOnSuccess, redirectUrl, telegramAuthToken, showWidgetAfterConnection, ssoProviderId, }) {
|
|
378
|
+
const connectSocialAccount = useCallback((_d) => __awaiter(void 0, [_d], void 0, function* ({ authMode, provider, validator, captchaToken, isHeadlessSocialSignIn, payingWithDynamic, triggerFundFromExchangeOnSuccess, redirectUrl, telegramAuthToken, showWidgetAfterConnection, forcePopup, ssoProviderId, }) {
|
|
376
379
|
var _e, _f;
|
|
377
380
|
clearError();
|
|
378
381
|
setIsProcessing(true);
|
|
@@ -428,6 +431,7 @@ const useSocialAuth = ({ onSettled, onError, onFarcasterUrl, }) => {
|
|
|
428
431
|
}
|
|
429
432
|
const isMobile$1 = isMobile();
|
|
430
433
|
try {
|
|
434
|
+
const effectiveStrategy = forcePopup ? 'popup' : strategy;
|
|
431
435
|
const authCode = yield Oauth2Service.getOauthCode({
|
|
432
436
|
apiProvider: getProviderByType((_f = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _f !== void 0 ? _f : [], provider),
|
|
433
437
|
getOAuthResultFromApi: () => getOAuthResult(environmentId, provider, {
|
|
@@ -446,7 +450,7 @@ const useSocialAuth = ({ onSettled, onError, onFarcasterUrl, }) => {
|
|
|
446
450
|
redirectUrl: redirectUrl !== null && redirectUrl !== void 0 ? redirectUrl : defaultRedirectUrl,
|
|
447
451
|
setIsProcessing,
|
|
448
452
|
state,
|
|
449
|
-
strategy,
|
|
453
|
+
strategy: effectiveStrategy,
|
|
450
454
|
});
|
|
451
455
|
yield completeConnection({
|
|
452
456
|
authCode,
|
|
@@ -32,6 +32,7 @@ var updatePrimaryWalletId = require('../../functions/updatePrimaryWalletId/updat
|
|
|
32
32
|
var connectedWalletsInfo = require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
33
33
|
require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
34
34
|
require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
35
|
+
var getClientSessionKeys = require('../../functions/clientSessionKeys/getClientSessionKeys.cjs');
|
|
35
36
|
require('@dynamic-labs-sdk/client/core');
|
|
36
37
|
require('../../../client/client.cjs');
|
|
37
38
|
require('@dynamic-labs-sdk/client');
|
|
@@ -145,6 +146,7 @@ const useVerifyWallet = ({ displaySiweStatement, environmentId, projectSettings,
|
|
|
145
146
|
const keypair = yield generateSessionKey();
|
|
146
147
|
verifyArgs.sessionPublicKey = keypair.publicKey;
|
|
147
148
|
}
|
|
149
|
+
yield getClientSessionKeys.generateClientSessionKeys();
|
|
148
150
|
let verifyResponse;
|
|
149
151
|
if (!user) {
|
|
150
152
|
verifyResponse = wallets.verifyWallet(environmentId, Object.assign(Object.assign({}, verifyArgs), { captchaToken,
|
|
@@ -28,6 +28,7 @@ import { updatePrimaryWalletId } from '../../functions/updatePrimaryWalletId/upd
|
|
|
28
28
|
import { resetConnectedWalletsInfo } from '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
29
29
|
import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
30
30
|
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
31
|
+
import { generateClientSessionKeys } from '../../functions/clientSessionKeys/getClientSessionKeys.js';
|
|
31
32
|
import '@dynamic-labs-sdk/client/core';
|
|
32
33
|
import '../../../client/client.js';
|
|
33
34
|
import '@dynamic-labs-sdk/client';
|
|
@@ -141,6 +142,7 @@ const useVerifyWallet = ({ displaySiweStatement, environmentId, projectSettings,
|
|
|
141
142
|
const keypair = yield generateSessionKey();
|
|
142
143
|
verifyArgs.sessionPublicKey = keypair.publicKey;
|
|
143
144
|
}
|
|
145
|
+
yield generateClientSessionKeys();
|
|
144
146
|
let verifyResponse;
|
|
145
147
|
if (!user) {
|
|
146
148
|
verifyResponse = verifyWallet(environmentId, Object.assign(Object.assign({}, verifyArgs), { captchaToken,
|
|
@@ -33,6 +33,7 @@ var updatePrimaryWalletId = require('../../utils/functions/updatePrimaryWalletId
|
|
|
33
33
|
require('../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
34
34
|
require('../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
35
35
|
require('../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
36
|
+
var getClientSessionKeys = require('../../utils/functions/clientSessionKeys/getClientSessionKeys.cjs');
|
|
36
37
|
var email = require('../../data/api/email/email.cjs');
|
|
37
38
|
require('@dynamic-labs/locale');
|
|
38
39
|
var dynamicEvents = require('../../events/dynamicEvents.cjs');
|
|
@@ -281,6 +282,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
281
282
|
const keypair = yield generateSessionKey();
|
|
282
283
|
sessionPublicKey = keypair.publicKey;
|
|
283
284
|
}
|
|
285
|
+
yield getClientSessionKeys.generateClientSessionKeys();
|
|
284
286
|
return email.signInWithEmailVerification({
|
|
285
287
|
environmentId,
|
|
286
288
|
sessionPublicKey,
|
|
@@ -29,6 +29,7 @@ import { updatePrimaryWalletId } from '../../utils/functions/updatePrimaryWallet
|
|
|
29
29
|
import '../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
30
30
|
import '../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
31
31
|
import '../../store/state/primaryWalletId/primaryWalletId.js';
|
|
32
|
+
import { generateClientSessionKeys } from '../../utils/functions/clientSessionKeys/getClientSessionKeys.js';
|
|
32
33
|
import { signInWithEmailVerification, retryEmailVerification } from '../../data/api/email/email.js';
|
|
33
34
|
import '@dynamic-labs/locale';
|
|
34
35
|
import { dynamicEvents } from '../../events/dynamicEvents.js';
|
|
@@ -277,6 +278,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
277
278
|
const keypair = yield generateSessionKey();
|
|
278
279
|
sessionPublicKey = keypair.publicKey;
|
|
279
280
|
}
|
|
281
|
+
yield generateClientSessionKeys();
|
|
280
282
|
return signInWithEmailVerification({
|
|
281
283
|
environmentId,
|
|
282
284
|
sessionPublicKey,
|
|
@@ -122,6 +122,7 @@ const getTransactionValue = (transaction, isNativeToken) => {
|
|
|
122
122
|
};
|
|
123
123
|
const getSupportedChainName = (connectedChain) => {
|
|
124
124
|
const supportedChains = {
|
|
125
|
+
APTOS: sdkApiCore.ChainEnum.Aptos,
|
|
125
126
|
EVM: sdkApiCore.ChainEnum.Evm,
|
|
126
127
|
SOL: sdkApiCore.ChainEnum.Sol,
|
|
127
128
|
SUI: sdkApiCore.ChainEnum.Sui,
|
|
@@ -118,6 +118,7 @@ const getTransactionValue = (transaction, isNativeToken) => {
|
|
|
118
118
|
};
|
|
119
119
|
const getSupportedChainName = (connectedChain) => {
|
|
120
120
|
const supportedChains = {
|
|
121
|
+
APTOS: ChainEnum.Aptos,
|
|
121
122
|
EVM: ChainEnum.Evm,
|
|
122
123
|
SOL: ChainEnum.Sol,
|
|
123
124
|
SUI: ChainEnum.Sui,
|
|
@@ -32,6 +32,7 @@ var sms = require('../../../data/api/sms/sms.cjs');
|
|
|
32
32
|
require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
33
33
|
require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
34
34
|
require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
35
|
+
var getClientSessionKeys = require('../../../utils/functions/clientSessionKeys/getClientSessionKeys.cjs');
|
|
35
36
|
require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
36
37
|
require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
37
38
|
require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
@@ -186,6 +187,7 @@ const useSmsVerification = (type) => {
|
|
|
186
187
|
const keypair = yield generateSessionKey();
|
|
187
188
|
sessionPublicKey = keypair.publicKey;
|
|
188
189
|
}
|
|
190
|
+
yield getClientSessionKeys.generateClientSessionKeys();
|
|
189
191
|
return sms.signInWithSmsVerification({
|
|
190
192
|
environmentId,
|
|
191
193
|
sessionPublicKey,
|
|
@@ -28,6 +28,7 @@ import { signInWithSmsVerification, retrySmsVerification } from '../../../data/a
|
|
|
28
28
|
import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
29
29
|
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
30
30
|
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
31
|
+
import { generateClientSessionKeys } from '../../../utils/functions/clientSessionKeys/getClientSessionKeys.js';
|
|
31
32
|
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
32
33
|
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
33
34
|
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
@@ -182,6 +183,7 @@ const useSmsVerification = (type) => {
|
|
|
182
183
|
const keypair = yield generateSessionKey();
|
|
183
184
|
sessionPublicKey = keypair.publicKey;
|
|
184
185
|
}
|
|
186
|
+
yield generateClientSessionKeys();
|
|
185
187
|
return signInWithSmsVerification({
|
|
186
188
|
environmentId,
|
|
187
189
|
sessionPublicKey,
|
|
@@ -13,6 +13,8 @@ var SettingsView = require('../../views/SettingsView/SettingsView.cjs');
|
|
|
13
13
|
var AccountAndSecuritySettingsView = require('../../views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.cjs');
|
|
14
14
|
var SessionManagementView = require('../../views/SessionManagementView/SessionManagementView.cjs');
|
|
15
15
|
var WalletsDelegatedSettingsView = require('../../views/WalletsDelegatedSettingsView/WalletsDelegatedSettingsView.cjs');
|
|
16
|
+
var WaasBackupView = require('../../views/WaasBackupView/WaasBackupView.cjs');
|
|
17
|
+
var WaasBackupInfoView = require('../../views/WaasBackupView/WaasBackupInfoView.cjs');
|
|
16
18
|
var CryptoComOnramp = require('../../views/CryptoComOnramp/CryptoComOnramp.cjs');
|
|
17
19
|
var ChooseLinkedWalletView = require('../../views/ChooseLinkedWalletView/ChooseLinkedWalletView.cjs');
|
|
18
20
|
var ChooseOnrampProviderView = require('../../views/ChooseOnrampProviderView/ChooseOnrampProviderView.cjs');
|
|
@@ -52,6 +54,8 @@ const mapViewToComponent = {
|
|
|
52
54
|
'session-management-info': SessionManagementInfoView.SessionManagementInfoView,
|
|
53
55
|
'session-management-revoke-access': RevokeAccessView.RevokeAccessView,
|
|
54
56
|
settings: SettingsView.SettingsView,
|
|
57
|
+
'waas-backup': WaasBackupView.WaasBackupView,
|
|
58
|
+
'waas-backup-info': WaasBackupInfoView.WaasBackupInfoView,
|
|
55
59
|
'wallet-delegation': WalletDelegationView.WalletDelegationView,
|
|
56
60
|
wallets: WalletsView.WalletsView,
|
|
57
61
|
'wallets-delegated-settings': WalletsDelegatedSettingsView.WalletsDelegatedSettingsView,
|
|
@@ -33,6 +33,8 @@ export declare const mapViewToComponent: {
|
|
|
33
33
|
'session-management-info': import("react").FC;
|
|
34
34
|
'session-management-revoke-access': import("react").FC<import("../../views/SessionManagementView/RevokeAccessView").RevokeAccessViewProps>;
|
|
35
35
|
settings: import("react").FC;
|
|
36
|
+
'waas-backup': import("react").FC;
|
|
37
|
+
'waas-backup-info': import("react").FC;
|
|
36
38
|
'wallet-delegation': import("react").FC<{
|
|
37
39
|
wallets?: import("dist/packages/wallet-connector-core/src").Wallet<import("dist/packages/wallet-connector-core/src").WalletConnectorCore.WalletConnector>[] | undefined;
|
|
38
40
|
}>;
|
|
@@ -9,6 +9,8 @@ import { SettingsView } from '../../views/SettingsView/SettingsView.js';
|
|
|
9
9
|
import { AccountAndSecuritySettingsView } from '../../views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.js';
|
|
10
10
|
import { SessionManagementView } from '../../views/SessionManagementView/SessionManagementView.js';
|
|
11
11
|
import { WalletsDelegatedSettingsView } from '../../views/WalletsDelegatedSettingsView/WalletsDelegatedSettingsView.js';
|
|
12
|
+
import { WaasBackupView } from '../../views/WaasBackupView/WaasBackupView.js';
|
|
13
|
+
import { WaasBackupInfoView } from '../../views/WaasBackupView/WaasBackupInfoView.js';
|
|
12
14
|
import { CryptoComOnramp } from '../../views/CryptoComOnramp/CryptoComOnramp.js';
|
|
13
15
|
import { ChooseLinkedWalletView } from '../../views/ChooseLinkedWalletView/ChooseLinkedWalletView.js';
|
|
14
16
|
import { ChooseOnrampProviderView } from '../../views/ChooseOnrampProviderView/ChooseOnrampProviderView.js';
|
|
@@ -48,6 +50,8 @@ const mapViewToComponent = {
|
|
|
48
50
|
'session-management-info': SessionManagementInfoView,
|
|
49
51
|
'session-management-revoke-access': RevokeAccessView,
|
|
50
52
|
settings: SettingsView,
|
|
53
|
+
'waas-backup': WaasBackupView,
|
|
54
|
+
'waas-backup-info': WaasBackupInfoView,
|
|
51
55
|
'wallet-delegation': WalletDelegationView,
|
|
52
56
|
wallets: WalletsView,
|
|
53
57
|
'wallets-delegated-settings': WalletsDelegatedSettingsView,
|
|
@@ -13,7 +13,7 @@ export declare const DynamicSessionManagementViews: readonly ["session-managemen
|
|
|
13
13
|
export type DynamicSessionManagementViewsType = typeof DynamicSessionManagementViews[number];
|
|
14
14
|
export declare const DynamicTransactionsWidgetViews: readonly ["send-balance"];
|
|
15
15
|
export type DynamicTransactionsWidgetViewsType = typeof DynamicTransactionsWidgetViews[number];
|
|
16
|
-
export type DynamicWidgetViews = 'wallets' | 'profile' | 'edit-profile' | 'choose-wallet-funding-method' | 'receive-wallet-funds' | 'deposited-exchange' | 'receive-exchange-funds' | 'crypto-com-onramp' | DynamicTransactionsWidgetViewsType | DynamicPasskeyWidgetViewsType | DynamicMfaWidgetViewsType | DynamicSettingsType | DynamicGlobalWalletType | DynamicSessionManagementViewsType | 'connected-apps' | 'deposit-view' | 'confirm-exchange-transfer' | 'choose-onramp-provider' | 'choose-linked-wallet' | 'wallet-delegation' | 'wallets-delegated-settings';
|
|
16
|
+
export type DynamicWidgetViews = 'wallets' | 'profile' | 'edit-profile' | 'choose-wallet-funding-method' | 'receive-wallet-funds' | 'deposited-exchange' | 'receive-exchange-funds' | 'crypto-com-onramp' | DynamicTransactionsWidgetViewsType | DynamicPasskeyWidgetViewsType | DynamicMfaWidgetViewsType | DynamicSettingsType | DynamicGlobalWalletType | DynamicSessionManagementViewsType | 'connected-apps' | 'deposit-view' | 'confirm-exchange-transfer' | 'choose-onramp-provider' | 'choose-linked-wallet' | 'waas-backup' | 'waas-backup-info' | 'wallet-delegation' | 'wallets-delegated-settings';
|
|
17
17
|
export type DynamicWidgetViewMapConstraint = Record<DynamicWidgetViews, FC<any>>;
|
|
18
18
|
export type DynamicWidgetViewMap = typeof mapViewToComponent;
|
|
19
19
|
export type SetDynamicWidgetView = <T extends DynamicWidgetViews>(view: T, props?: ComponentProps<DynamicWidgetViewMap[T]>) => void;
|
|
@@ -7,6 +7,7 @@ var _tslib = require('../../../../../../../_virtual/_tslib.cjs');
|
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var reactI18next = require('react-i18next');
|
|
10
|
+
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
10
11
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
11
12
|
var Typography = require('../../../../../components/Typography/Typography.cjs');
|
|
12
13
|
var TypographyButton = require('../../../../../components/TypographyButton/TypographyButton.cjs');
|
|
@@ -17,12 +18,12 @@ var chevronLeft = require('../../../../../shared/assets/chevron-left.cjs');
|
|
|
17
18
|
var exportPrivateKey = require('../../../../../shared/assets/export-private-key.cjs');
|
|
18
19
|
var exportRecoveryPhrase = require('../../../../../shared/assets/export-recovery-phrase.cjs');
|
|
19
20
|
require('../../../../../context/ViewContext/ViewContext.cjs');
|
|
21
|
+
var backupArrow = require('../../../../../shared/assets/backupArrow.cjs');
|
|
20
22
|
require('../../../../../shared/logger.cjs');
|
|
21
23
|
require('@dynamic-labs/wallet-book');
|
|
22
24
|
require('@dynamic-labs/utils');
|
|
23
25
|
require('../../../../../utils/constants/colors.cjs');
|
|
24
26
|
require('../../../../../utils/constants/values.cjs');
|
|
25
|
-
require('@dynamic-labs/sdk-api-core');
|
|
26
27
|
require('../../../../../shared/consts/index.cjs');
|
|
27
28
|
require('../../../../../events/dynamicEvents.cjs');
|
|
28
29
|
require('../../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
@@ -87,7 +88,7 @@ require('../../../../../context/IpConfigurationContext/IpConfigurationContext.cj
|
|
|
87
88
|
require('../../../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
88
89
|
require('../../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
89
90
|
require('@hcaptcha/react-hcaptcha');
|
|
90
|
-
require('../../../context/DynamicWidgetContext.cjs');
|
|
91
|
+
var DynamicWidgetContext = require('../../../context/DynamicWidgetContext.cjs');
|
|
91
92
|
require('../../../helpers/convertExchangeKeyAndProviderEnum.cjs');
|
|
92
93
|
require('../../../../../views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.cjs');
|
|
93
94
|
require('../../../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
@@ -111,10 +112,11 @@ require('../../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs')
|
|
|
111
112
|
var useInternalDynamicContext = require('../../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
112
113
|
|
|
113
114
|
const EmbeddedWalletExportSection = () => {
|
|
114
|
-
var _a, _b, _c, _d, _e, _f;
|
|
115
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
115
116
|
const { t } = reactI18next.useTranslation();
|
|
116
117
|
const { theme } = ThemeContext.useThemeContext();
|
|
117
|
-
const { primaryWallet, user } = useInternalDynamicContext.useInternalDynamicContext();
|
|
118
|
+
const { primaryWallet, user, projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
|
|
119
|
+
const { setDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
118
120
|
const { getEOAWallet } = useSmartWallets.useSmartWallets();
|
|
119
121
|
const { initPasskeyRecoveryProcess, shouldInitRecovery } = usePasskeyRecovery.usePasskeyRecovery();
|
|
120
122
|
const { initExportProcess } = useEmbeddedReveal.useEmbeddedReveal();
|
|
@@ -146,6 +148,12 @@ const EmbeddedWalletExportSection = () => {
|
|
|
146
148
|
const handleExportButtonClick = React.useCallback(() => handleExportClick(), [handleExportClick]);
|
|
147
149
|
const handleExportWithPhraseClick = React.useCallback(() => handleExportClick(true), [handleExportClick]);
|
|
148
150
|
const exportIconClasses = React.useMemo(() => `settings-view__body__section__button__icon${theme.theme.name === 'dark' ? '__stroke' : ''}`, [theme.theme.name]);
|
|
151
|
+
const isV3WaasWallet = Boolean(wallet && ((_h = (_g = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _g === void 0 ? void 0 : _g.key) === null || _h === void 0 ? void 0 : _h.startsWith('dynamicwaas')));
|
|
152
|
+
const isGoogleDriveBackupEnabled = Boolean((_l = (_k = (_j = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _j === void 0 ? void 0 : _j.waas) === null || _k === void 0 ? void 0 : _k.backupOptions) === null || _l === void 0 ? void 0 : _l.includes(sdkApiCore.WaasBackupOptionsEnum.GoogleDrive));
|
|
153
|
+
const shouldShowBackupOption = isV3WaasWallet && isGoogleDriveBackupEnabled;
|
|
154
|
+
const handleBackupClick = React.useCallback(() => {
|
|
155
|
+
setDynamicWidgetView('waas-backup');
|
|
156
|
+
}, [setDynamicWidgetView]);
|
|
149
157
|
if (!isEmbeddedWallet) {
|
|
150
158
|
return null;
|
|
151
159
|
}
|
|
@@ -153,7 +161,9 @@ const EmbeddedWalletExportSection = () => {
|
|
|
153
161
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
154
162
|
jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportPrivateKey.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.private_key_button', children: t('dyn_settings.export_section.private_key_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }), isTurnkeyHDWallet && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'embedded-reveal-button', onClick: handleExportWithPhraseClick, buttonClassName: 'settings-view__body__section__button', startSlot:
|
|
155
163
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
156
|
-
jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportRecoveryPhrase.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.srp_button', children: t('dyn_settings.export_section.srp_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))
|
|
164
|
+
jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportRecoveryPhrase.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.srp_button', children: t('dyn_settings.export_section.srp_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false })), shouldShowBackupOption && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'backup-button', onClick: handleBackupClick, buttonClassName: 'settings-view__body__section__button', startSlot:
|
|
165
|
+
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
166
|
+
jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(backupArrow.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.backup_button', children: t('dyn_settings.export_section.backup_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] }));
|
|
157
167
|
};
|
|
158
168
|
|
|
159
169
|
exports.EmbeddedWalletExportSection = EmbeddedWalletExportSection;
|