@dynamic-labs/sdk-react-core 4.22.6 → 4.22.7
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 +8 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +78 -58
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +78 -58
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.cjs +2 -2
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.d.ts +1 -1
- package/src/lib/views/EmbeddedReveal/utils/waasExport/waasExport.js +2 -2
- /package/src/lib/utils/functions/getPrimaryTurnkeyWalletId/{inedex.d.ts → index.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.22.7](https://github.com/dynamic-labs/dynamic-auth/compare/v4.22.6...v4.22.7) (2025-07-09)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add auth token sync to waas signTypedData ([#9133](https://github.com/dynamic-labs/dynamic-auth/issues/9133)) ([6d52a1e](https://github.com/dynamic-labs/dynamic-auth/commit/6d52a1ea2556f6e304a58cdab833487c7227a117))
|
|
8
|
+
* export key loading state waits until waas export key is finished ([#9143](https://github.com/dynamic-labs/dynamic-auth/issues/9143)) ([a9b3b90](https://github.com/dynamic-labs/dynamic-auth/commit/a9b3b901561708ce4e0c540ed895b5b335569fd8))
|
|
9
|
+
|
|
2
10
|
### [4.22.6](https://github.com/dynamic-labs/dynamic-auth/compare/v4.22.5...v4.22.6) (2025-07-09)
|
|
3
11
|
|
|
4
12
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.22.
|
|
3
|
+
"version": "4.22.7",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.706",
|
|
6
6
|
"@dynamic-labs-sdk/client": "0.0.1-alpha.13",
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"yup": "0.32.11",
|
|
16
16
|
"react-international-phone": "4.5.0",
|
|
17
17
|
"bs58": "5.0.0",
|
|
18
|
-
"@dynamic-labs/assert-package-version": "4.22.
|
|
19
|
-
"@dynamic-labs/iconic": "4.22.
|
|
20
|
-
"@dynamic-labs/logger": "4.22.
|
|
21
|
-
"@dynamic-labs/multi-wallet": "4.22.
|
|
22
|
-
"@dynamic-labs/rpc-providers": "4.22.
|
|
23
|
-
"@dynamic-labs/store": "4.22.
|
|
24
|
-
"@dynamic-labs/types": "4.22.
|
|
25
|
-
"@dynamic-labs/utils": "4.22.
|
|
26
|
-
"@dynamic-labs/wallet-book": "4.22.
|
|
27
|
-
"@dynamic-labs/wallet-connector-core": "4.22.
|
|
18
|
+
"@dynamic-labs/assert-package-version": "4.22.7",
|
|
19
|
+
"@dynamic-labs/iconic": "4.22.7",
|
|
20
|
+
"@dynamic-labs/logger": "4.22.7",
|
|
21
|
+
"@dynamic-labs/multi-wallet": "4.22.7",
|
|
22
|
+
"@dynamic-labs/rpc-providers": "4.22.7",
|
|
23
|
+
"@dynamic-labs/store": "4.22.7",
|
|
24
|
+
"@dynamic-labs/types": "4.22.7",
|
|
25
|
+
"@dynamic-labs/utils": "4.22.7",
|
|
26
|
+
"@dynamic-labs/wallet-book": "4.22.7",
|
|
27
|
+
"@dynamic-labs/wallet-connector-core": "4.22.7",
|
|
28
28
|
"eventemitter3": "5.0.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
@@ -9,29 +9,26 @@ var React = require('react');
|
|
|
9
9
|
var reactI18next = require('react-i18next');
|
|
10
10
|
var utils = require('@dynamic-labs/utils');
|
|
11
11
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
12
|
-
|
|
13
|
-
var Checkbox = require('../../../components/Checkbox/Checkbox.cjs');
|
|
14
|
-
var ErrorContainer = require('../../../components/ErrorContainer/ErrorContainer.cjs');
|
|
15
|
-
var IconButton = require('../../../components/IconButton/IconButton.cjs');
|
|
16
|
-
var ModalHeader = require('../../../components/ModalHeader/ModalHeader.cjs');
|
|
17
|
-
var Typography = require('../../../components/Typography/Typography.cjs');
|
|
18
|
-
var TypographyButton = require('../../../components/TypographyButton/TypographyButton.cjs');
|
|
19
|
-
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
20
|
-
require('../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
21
|
-
require('@dynamic-labs/sdk-api-core');
|
|
22
|
-
var logger = require('../../../shared/logger.cjs');
|
|
23
|
-
require('@dynamic-labs/iconic');
|
|
12
|
+
require('../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
24
13
|
var close = require('../../../shared/assets/close.cjs');
|
|
25
14
|
var exportEmbeddedHero = require('../../../shared/assets/export-embedded-hero.cjs');
|
|
26
15
|
var eyeOffIcon = require('../../../shared/assets/eye-off-icon.cjs');
|
|
27
16
|
var info = require('../../../shared/assets/info.cjs');
|
|
28
17
|
var walletV2 = require('../../../shared/assets/wallet-v2.cjs');
|
|
18
|
+
require('@dynamic-labs/iconic');
|
|
29
19
|
var ViewContext = require('../../../context/ViewContext/ViewContext.cjs');
|
|
20
|
+
require('@dynamic-labs/sdk-api-core');
|
|
21
|
+
var logger = require('../../../shared/logger.cjs');
|
|
30
22
|
require('@dynamic-labs/wallet-book');
|
|
31
23
|
require('../../../utils/constants/colors.cjs');
|
|
32
24
|
require('../../../utils/constants/values.cjs');
|
|
33
25
|
require('../../../shared/consts/index.cjs');
|
|
26
|
+
require('../../../components/Alert/Alert.cjs');
|
|
34
27
|
var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
28
|
+
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
29
|
+
require('../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
30
|
+
require('../../../store/state/authMode/authMode.cjs');
|
|
31
|
+
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
35
32
|
require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
36
33
|
require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
37
34
|
var errors = require('../../../utils/constants/errors.cjs');
|
|
@@ -50,7 +47,6 @@ require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
|
50
47
|
require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
51
48
|
require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
52
49
|
require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
53
|
-
require('../../../store/state/authMode/authMode.cjs');
|
|
54
50
|
require('../../../context/VerificationContext/VerificationContext.cjs');
|
|
55
51
|
require('react-dom');
|
|
56
52
|
require('../../../utils/functions/compareChains/compareChains.cjs');
|
|
@@ -76,51 +72,55 @@ require('../../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
|
76
72
|
require('../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
77
73
|
require('@dynamic-labs/rpc-providers');
|
|
78
74
|
require('../../../store/state/walletOptions/walletOptions.cjs');
|
|
79
|
-
require('../../../components/
|
|
80
|
-
require('../../../
|
|
75
|
+
var Typography = require('../../../components/Typography/Typography.cjs');
|
|
76
|
+
require('../../../context/FooterAnimationContext/index.cjs');
|
|
81
77
|
require('../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
82
|
-
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
83
|
-
require('../../../components/Input/Input.cjs');
|
|
84
|
-
require('../../../components/IsBrowser/IsBrowser.cjs');
|
|
85
|
-
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
86
|
-
require('../../../components/OverlayCard/OverlayCard.cjs');
|
|
87
78
|
require('../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
88
79
|
require('../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
89
80
|
require('../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
90
|
-
|
|
91
|
-
require('../../../
|
|
92
|
-
require('../../../components/
|
|
93
|
-
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
81
|
+
require('../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
82
|
+
require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
83
|
+
require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
94
84
|
require('react-focus-lock');
|
|
95
|
-
require('
|
|
85
|
+
var DynamicWidgetContext = require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
86
|
+
var IconButton = require('../../../components/IconButton/IconButton.cjs');
|
|
87
|
+
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
88
|
+
var Badge = require('../../../components/Badge/Badge.cjs');
|
|
89
|
+
var ErrorContainer = require('../../../components/ErrorContainer/ErrorContainer.cjs');
|
|
90
|
+
var TypographyButton = require('../../../components/TypographyButton/TypographyButton.cjs');
|
|
96
91
|
require('formik');
|
|
97
92
|
require('../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
|
|
98
|
-
require('../../../
|
|
93
|
+
var ModalHeader = require('../../../components/ModalHeader/ModalHeader.cjs');
|
|
94
|
+
require('../../../store/state/sendBalances.cjs');
|
|
95
|
+
require('../../../components/Input/Input.cjs');
|
|
96
|
+
require('../../../components/OverlayCard/OverlayCard.cjs');
|
|
97
|
+
require('../../TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
98
|
+
require('../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
99
|
+
require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
100
|
+
require('../../../context/OnrampContext/OnrampContext.cjs');
|
|
101
|
+
require('../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.cjs');
|
|
102
|
+
require('qrcode');
|
|
103
|
+
require('../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
104
|
+
var getProperErrorMessage = require('../../../modals/SignMessageConfirmationModal/getProperErrorMessage.cjs');
|
|
105
|
+
require('../../../../index.cjs');
|
|
106
|
+
var NeedHelpSection = require('../../../components/NeedHelpSection/NeedHelpSection.cjs');
|
|
99
107
|
require('../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
100
108
|
require('../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
101
109
|
require('../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
102
110
|
require('@hcaptcha/react-hcaptcha');
|
|
103
|
-
var
|
|
104
|
-
var DynamicWidgetContext = require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
111
|
+
var Checkbox = require('../../../components/Checkbox/Checkbox.cjs');
|
|
105
112
|
var constants = require('../constants.cjs');
|
|
106
113
|
var waasExport = require('../utils/waasExport/waasExport.cjs');
|
|
107
|
-
require('../../../context/FooterAnimationContext/index.cjs');
|
|
108
114
|
require('../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
109
|
-
require('../../../
|
|
110
|
-
require('../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.cjs');
|
|
111
|
-
require('../../../store/state/sendBalances.cjs');
|
|
115
|
+
require('../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
112
116
|
require('../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
113
|
-
require('../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
114
|
-
require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
115
|
-
require('../../TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
116
|
-
require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
117
|
-
require('../../../context/OnrampContext/OnrampContext.cjs');
|
|
118
|
-
require('../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
119
|
-
require('../../../../index.cjs');
|
|
120
117
|
require('../../../store/state/tokenBalances.cjs');
|
|
121
118
|
var useSyncEmbeddedWalletFlow = require('../../../utils/hooks/useSyncEmbeddedWalletFlow/useSyncEmbeddedWalletFlow.cjs');
|
|
122
119
|
require('../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
123
|
-
|
|
120
|
+
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
121
|
+
require('../../../components/IsBrowser/IsBrowser.cjs');
|
|
122
|
+
require('../../../components/Popper/Popper/Popper.cjs');
|
|
123
|
+
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
124
124
|
|
|
125
125
|
const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) => {
|
|
126
126
|
var _a, _b, _c;
|
|
@@ -133,6 +133,8 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
133
133
|
const { getEOAWallet, isSmartWallet } = useSmartWallets.useSmartWallets();
|
|
134
134
|
const [acknowledgement1, setAcknowledgement1] = React.useState(false);
|
|
135
135
|
const iframeContainerRef = React.useRef(null);
|
|
136
|
+
const [showSkeleton, setShowSkeleton] = React.useState(false);
|
|
137
|
+
const [waasExportComplete, setWaasExportComplete] = React.useState(false);
|
|
136
138
|
if (!primaryWallet) {
|
|
137
139
|
throw new utils.DynamicError('No primary wallet found', errors.INVALID_WALLET_DATA);
|
|
138
140
|
}
|
|
@@ -146,7 +148,6 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
146
148
|
const walletProperties = (_b = (_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find(({ walletName, id }) => (walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey')) && id === primaryTurnkeyWalletId)) === null || _b === void 0 ? void 0 : _b.walletProperties;
|
|
147
149
|
const isTurnkeyHDWallet = walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.turnkeyHDWalletId;
|
|
148
150
|
const wallet = (_c = (primaryWallet && getEOAWallet(primaryWallet))) !== null && _c !== void 0 ? _c : primaryWallet;
|
|
149
|
-
const [showSkeleton, setShowSkeleton] = React.useState(false);
|
|
150
151
|
// eslint-disable-next-line arrow-body-style
|
|
151
152
|
React.useEffect(() => {
|
|
152
153
|
return () => {
|
|
@@ -212,17 +213,22 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
212
213
|
}
|
|
213
214
|
}
|
|
214
215
|
if (isWaasWallet) {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
216
|
+
// Start the export in the background
|
|
217
|
+
waasExport.exportWaasCredential({
|
|
218
|
+
address: exportPrivateKey ? wallet === null || wallet === void 0 ? void 0 : wallet.address : undefined,
|
|
219
|
+
iframeContainer: iframeContainerRef.current,
|
|
220
|
+
user,
|
|
221
|
+
wallet: wallet,
|
|
222
|
+
})
|
|
223
|
+
.then(() => {
|
|
224
|
+
setWaasExportComplete(true);
|
|
225
|
+
})
|
|
226
|
+
.catch((error) => {
|
|
227
|
+
logger.logger.error(`Failed in exporting waas wallet ${wallet === null || wallet === void 0 ? void 0 : wallet.id}`, error);
|
|
228
|
+
dynamicEvents.dynamicEvents.emit('embeddedWalletRevealFailed', error);
|
|
229
|
+
});
|
|
230
|
+
// Return true immediately to show skeleton
|
|
231
|
+
return true;
|
|
226
232
|
}
|
|
227
233
|
return undefined;
|
|
228
234
|
}), {
|
|
@@ -231,6 +237,12 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
231
237
|
dynamicEvents.dynamicEvents.emit('embeddedWalletRevealFailed', err);
|
|
232
238
|
},
|
|
233
239
|
});
|
|
240
|
+
// Reset waasExportComplete when data changes to false (new export starting)
|
|
241
|
+
React.useEffect(() => {
|
|
242
|
+
if (!data) {
|
|
243
|
+
setWaasExportComplete(false);
|
|
244
|
+
}
|
|
245
|
+
}, [data]);
|
|
234
246
|
const errorText = React.useMemo(() => {
|
|
235
247
|
if (!error) {
|
|
236
248
|
return undefined;
|
|
@@ -261,14 +273,22 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
261
273
|
if (data) {
|
|
262
274
|
// Show skeleton first
|
|
263
275
|
setShowSkeleton(true);
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
276
|
+
if (isWaasWallet) {
|
|
277
|
+
// For WAAS wallets, hide skeleton when export is actually complete
|
|
278
|
+
if (waasExportComplete) {
|
|
279
|
+
setShowSkeleton(false);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
// For other wallets, use the fixed 2-second delay
|
|
284
|
+
const timer = setTimeout(() => {
|
|
285
|
+
setShowSkeleton(false);
|
|
286
|
+
}, 2000);
|
|
287
|
+
return () => clearTimeout(timer);
|
|
288
|
+
}
|
|
269
289
|
}
|
|
270
290
|
return;
|
|
271
|
-
}, [data]);
|
|
291
|
+
}, [data, isWaasWallet, waasExportComplete]);
|
|
272
292
|
const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { onClick: () => {
|
|
273
293
|
setShowAuthFlow(false);
|
|
274
294
|
}, type: 'button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
@@ -5,29 +5,26 @@ import { useState, useRef, useEffect, useMemo } from 'react';
|
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { DynamicError, AccessBlockedError } from '@dynamic-labs/utils';
|
|
7
7
|
import { isSessionKeyCompatibleWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
8
|
-
import
|
|
9
|
-
import { Checkbox } from '../../../components/Checkbox/Checkbox.js';
|
|
10
|
-
import { ErrorContainer } from '../../../components/ErrorContainer/ErrorContainer.js';
|
|
11
|
-
import { IconButton } from '../../../components/IconButton/IconButton.js';
|
|
12
|
-
import { ModalHeader } from '../../../components/ModalHeader/ModalHeader.js';
|
|
13
|
-
import { Typography } from '../../../components/Typography/Typography.js';
|
|
14
|
-
import { TypographyButton } from '../../../components/TypographyButton/TypographyButton.js';
|
|
15
|
-
import '../../../context/DynamicContext/DynamicContext.js';
|
|
16
|
-
import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
17
|
-
import '@dynamic-labs/sdk-api-core';
|
|
18
|
-
import { logger } from '../../../shared/logger.js';
|
|
19
|
-
import '@dynamic-labs/iconic';
|
|
8
|
+
import '../../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
20
9
|
import { ReactComponent as SvgClose } from '../../../shared/assets/close.js';
|
|
21
10
|
import { ReactComponent as SvgExportEmbeddedHero } from '../../../shared/assets/export-embedded-hero.js';
|
|
22
11
|
import { ReactComponent as SvgEyeOffIcon } from '../../../shared/assets/eye-off-icon.js';
|
|
23
12
|
import { ReactComponent as SvgInfo } from '../../../shared/assets/info.js';
|
|
24
13
|
import { ReactComponent as SvgWalletV2 } from '../../../shared/assets/wallet-v2.js';
|
|
14
|
+
import '@dynamic-labs/iconic';
|
|
25
15
|
import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
16
|
+
import '@dynamic-labs/sdk-api-core';
|
|
17
|
+
import { logger } from '../../../shared/logger.js';
|
|
26
18
|
import '@dynamic-labs/wallet-book';
|
|
27
19
|
import '../../../utils/constants/colors.js';
|
|
28
20
|
import '../../../utils/constants/values.js';
|
|
29
21
|
import '../../../shared/consts/index.js';
|
|
22
|
+
import '../../../components/Alert/Alert.js';
|
|
30
23
|
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
24
|
+
import '../../../context/DynamicContext/DynamicContext.js';
|
|
25
|
+
import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
26
|
+
import '../../../store/state/authMode/authMode.js';
|
|
27
|
+
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
31
28
|
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
32
29
|
import '../../../context/ErrorContext/ErrorContext.js';
|
|
33
30
|
import { INVALID_WALLET_DATA } from '../../../utils/constants/errors.js';
|
|
@@ -46,7 +43,6 @@ import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
|
46
43
|
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
47
44
|
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
48
45
|
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
49
|
-
import '../../../store/state/authMode/authMode.js';
|
|
50
46
|
import '../../../context/VerificationContext/VerificationContext.js';
|
|
51
47
|
import 'react-dom';
|
|
52
48
|
import '../../../utils/functions/compareChains/compareChains.js';
|
|
@@ -72,51 +68,55 @@ import '../../../context/FieldsStateContext/FieldsStateContext.js';
|
|
|
72
68
|
import '../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
73
69
|
import '@dynamic-labs/rpc-providers';
|
|
74
70
|
import '../../../store/state/walletOptions/walletOptions.js';
|
|
75
|
-
import '../../../components/
|
|
76
|
-
import '../../../
|
|
71
|
+
import { Typography } from '../../../components/Typography/Typography.js';
|
|
72
|
+
import '../../../context/FooterAnimationContext/index.js';
|
|
77
73
|
import '../../../components/ShadowDOM/ShadowDOM.js';
|
|
78
|
-
import '../../../components/InlineWidget/InlineWidget.js';
|
|
79
|
-
import '../../../components/Input/Input.js';
|
|
80
|
-
import '../../../components/IsBrowser/IsBrowser.js';
|
|
81
|
-
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
82
|
-
import '../../../components/OverlayCard/OverlayCard.js';
|
|
83
74
|
import '../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
84
75
|
import '../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
85
76
|
import '../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
86
|
-
import
|
|
87
|
-
import '../../../
|
|
88
|
-
import '../../../components/
|
|
89
|
-
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
77
|
+
import '../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
78
|
+
import '../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
79
|
+
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
90
80
|
import 'react-focus-lock';
|
|
91
|
-
import '
|
|
81
|
+
import { useWidgetContext } from '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
82
|
+
import { IconButton } from '../../../components/IconButton/IconButton.js';
|
|
83
|
+
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
84
|
+
import { Badge } from '../../../components/Badge/Badge.js';
|
|
85
|
+
import { ErrorContainer } from '../../../components/ErrorContainer/ErrorContainer.js';
|
|
86
|
+
import { TypographyButton } from '../../../components/TypographyButton/TypographyButton.js';
|
|
92
87
|
import 'formik';
|
|
93
88
|
import '../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
|
|
94
|
-
import '../../../
|
|
89
|
+
import { ModalHeader } from '../../../components/ModalHeader/ModalHeader.js';
|
|
90
|
+
import '../../../store/state/sendBalances.js';
|
|
91
|
+
import '../../../components/Input/Input.js';
|
|
92
|
+
import '../../../components/OverlayCard/OverlayCard.js';
|
|
93
|
+
import '../../TransactionConfirmationView/TransactionConfirmationView.js';
|
|
94
|
+
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
95
|
+
import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
96
|
+
import '../../../context/OnrampContext/OnrampContext.js';
|
|
97
|
+
import '../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.js';
|
|
98
|
+
import 'qrcode';
|
|
99
|
+
import '../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
100
|
+
import { getProperErrorMessage } from '../../../modals/SignMessageConfirmationModal/getProperErrorMessage.js';
|
|
101
|
+
import '../../../../index.js';
|
|
102
|
+
import { NeedHelpSection } from '../../../components/NeedHelpSection/NeedHelpSection.js';
|
|
95
103
|
import '../../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
96
104
|
import '../../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
97
105
|
import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
98
106
|
import '@hcaptcha/react-hcaptcha';
|
|
99
|
-
import {
|
|
100
|
-
import { useWidgetContext } from '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
107
|
+
import { Checkbox } from '../../../components/Checkbox/Checkbox.js';
|
|
101
108
|
import { iframeContainerId, iframeElementId } from '../constants.js';
|
|
102
109
|
import { cleanupExport as cleanupExport$1, exportWaasCredential } from '../utils/waasExport/waasExport.js';
|
|
103
|
-
import '../../../context/FooterAnimationContext/index.js';
|
|
104
110
|
import '../../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
|
|
105
|
-
import '../../../
|
|
106
|
-
import '../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.js';
|
|
107
|
-
import '../../../store/state/sendBalances.js';
|
|
111
|
+
import '../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
108
112
|
import '../../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
109
|
-
import '../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
110
|
-
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
111
|
-
import '../../TransactionConfirmationView/TransactionConfirmationView.js';
|
|
112
|
-
import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
113
|
-
import '../../../context/OnrampContext/OnrampContext.js';
|
|
114
|
-
import '../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
115
|
-
import '../../../../index.js';
|
|
116
113
|
import '../../../store/state/tokenBalances.js';
|
|
117
114
|
import { useSyncEmbeddedWalletFlow } from '../../../utils/hooks/useSyncEmbeddedWalletFlow/useSyncEmbeddedWalletFlow.js';
|
|
118
115
|
import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
119
|
-
import
|
|
116
|
+
import '../../../components/InlineWidget/InlineWidget.js';
|
|
117
|
+
import '../../../components/IsBrowser/IsBrowser.js';
|
|
118
|
+
import '../../../components/Popper/Popper/Popper.js';
|
|
119
|
+
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
120
120
|
|
|
121
121
|
const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) => {
|
|
122
122
|
var _a, _b, _c;
|
|
@@ -129,6 +129,8 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
129
129
|
const { getEOAWallet, isSmartWallet } = useSmartWallets();
|
|
130
130
|
const [acknowledgement1, setAcknowledgement1] = useState(false);
|
|
131
131
|
const iframeContainerRef = useRef(null);
|
|
132
|
+
const [showSkeleton, setShowSkeleton] = useState(false);
|
|
133
|
+
const [waasExportComplete, setWaasExportComplete] = useState(false);
|
|
132
134
|
if (!primaryWallet) {
|
|
133
135
|
throw new DynamicError('No primary wallet found', INVALID_WALLET_DATA);
|
|
134
136
|
}
|
|
@@ -142,7 +144,6 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
142
144
|
const walletProperties = (_b = (_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find(({ walletName, id }) => (walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey')) && id === primaryTurnkeyWalletId)) === null || _b === void 0 ? void 0 : _b.walletProperties;
|
|
143
145
|
const isTurnkeyHDWallet = walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.turnkeyHDWalletId;
|
|
144
146
|
const wallet = (_c = (primaryWallet && getEOAWallet(primaryWallet))) !== null && _c !== void 0 ? _c : primaryWallet;
|
|
145
|
-
const [showSkeleton, setShowSkeleton] = useState(false);
|
|
146
147
|
// eslint-disable-next-line arrow-body-style
|
|
147
148
|
useEffect(() => {
|
|
148
149
|
return () => {
|
|
@@ -208,17 +209,22 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
208
209
|
}
|
|
209
210
|
}
|
|
210
211
|
if (isWaasWallet) {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
212
|
+
// Start the export in the background
|
|
213
|
+
exportWaasCredential({
|
|
214
|
+
address: exportPrivateKey ? wallet === null || wallet === void 0 ? void 0 : wallet.address : undefined,
|
|
215
|
+
iframeContainer: iframeContainerRef.current,
|
|
216
|
+
user,
|
|
217
|
+
wallet: wallet,
|
|
218
|
+
})
|
|
219
|
+
.then(() => {
|
|
220
|
+
setWaasExportComplete(true);
|
|
221
|
+
})
|
|
222
|
+
.catch((error) => {
|
|
223
|
+
logger.error(`Failed in exporting waas wallet ${wallet === null || wallet === void 0 ? void 0 : wallet.id}`, error);
|
|
224
|
+
dynamicEvents.emit('embeddedWalletRevealFailed', error);
|
|
225
|
+
});
|
|
226
|
+
// Return true immediately to show skeleton
|
|
227
|
+
return true;
|
|
222
228
|
}
|
|
223
229
|
return undefined;
|
|
224
230
|
}), {
|
|
@@ -227,6 +233,12 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
227
233
|
dynamicEvents.emit('embeddedWalletRevealFailed', err);
|
|
228
234
|
},
|
|
229
235
|
});
|
|
236
|
+
// Reset waasExportComplete when data changes to false (new export starting)
|
|
237
|
+
useEffect(() => {
|
|
238
|
+
if (!data) {
|
|
239
|
+
setWaasExportComplete(false);
|
|
240
|
+
}
|
|
241
|
+
}, [data]);
|
|
230
242
|
const errorText = useMemo(() => {
|
|
231
243
|
if (!error) {
|
|
232
244
|
return undefined;
|
|
@@ -257,14 +269,22 @@ const EmbeddedRevealView = ({ exportPrivateKey, isPromptForExport = false, }) =>
|
|
|
257
269
|
if (data) {
|
|
258
270
|
// Show skeleton first
|
|
259
271
|
setShowSkeleton(true);
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
272
|
+
if (isWaasWallet) {
|
|
273
|
+
// For WAAS wallets, hide skeleton when export is actually complete
|
|
274
|
+
if (waasExportComplete) {
|
|
275
|
+
setShowSkeleton(false);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
// For other wallets, use the fixed 2-second delay
|
|
280
|
+
const timer = setTimeout(() => {
|
|
281
|
+
setShowSkeleton(false);
|
|
282
|
+
}, 2000);
|
|
283
|
+
return () => clearTimeout(timer);
|
|
284
|
+
}
|
|
265
285
|
}
|
|
266
286
|
return;
|
|
267
|
-
}, [data]);
|
|
287
|
+
}, [data, isWaasWallet, waasExportComplete]);
|
|
268
288
|
const closeButton = (jsx(IconButton, { onClick: () => {
|
|
269
289
|
setShowAuthFlow(false);
|
|
270
290
|
}, type: 'button', children: jsx(SvgClose, {}) }));
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var utils = require('@dynamic-labs/utils');
|
|
8
|
-
var errors = require('../../../../utils/constants/errors.cjs');
|
|
9
8
|
var logger = require('../../../../shared/logger.cjs');
|
|
9
|
+
var errors = require('../../../../utils/constants/errors.cjs');
|
|
10
10
|
|
|
11
11
|
const handleExportInitCheck = ({ user, wallet, }) => {
|
|
12
12
|
var _a, _b;
|
|
@@ -31,7 +31,7 @@ const exportWaasCredential = (_a) => _tslib.__awaiter(void 0, [_a], void 0, func
|
|
|
31
31
|
user,
|
|
32
32
|
wallet,
|
|
33
33
|
});
|
|
34
|
-
connector.exportPrivateKey({
|
|
34
|
+
yield connector.exportPrivateKey({
|
|
35
35
|
accountAddress: address || (walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.accountAddress),
|
|
36
36
|
displayContainer: iframeContainer,
|
|
37
37
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Wallet } from '../../../../shared';
|
|
2
1
|
import { UserProfile } from '../../../../..';
|
|
2
|
+
import { Wallet } from '../../../../shared';
|
|
3
3
|
export declare const exportWaasCredential: ({ user, wallet, address, iframeContainer, }: {
|
|
4
4
|
user: UserProfile | undefined;
|
|
5
5
|
wallet: Wallet | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { DynamicError } from '@dynamic-labs/utils';
|
|
4
|
-
import { USER_NOT_LOGGED_IN } from '../../../../utils/constants/errors.js';
|
|
5
4
|
import { logger } from '../../../../shared/logger.js';
|
|
5
|
+
import { USER_NOT_LOGGED_IN } from '../../../../utils/constants/errors.js';
|
|
6
6
|
|
|
7
7
|
const handleExportInitCheck = ({ user, wallet, }) => {
|
|
8
8
|
var _a, _b;
|
|
@@ -27,7 +27,7 @@ const exportWaasCredential = (_a) => __awaiter(void 0, [_a], void 0, function* (
|
|
|
27
27
|
user,
|
|
28
28
|
wallet,
|
|
29
29
|
});
|
|
30
|
-
connector.exportPrivateKey({
|
|
30
|
+
yield connector.exportPrivateKey({
|
|
31
31
|
accountAddress: address || (walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.accountAddress),
|
|
32
32
|
displayContainer: iframeContainer,
|
|
33
33
|
});
|
|
File without changes
|