@dynamic-labs/sdk-react-core 0.19.0-alpha.16 → 0.19.0-alpha.17
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 +2 -2
- package/package.js +2 -2
- package/package.json +9 -9
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.cjs +4 -3
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.js +4 -3
- package/src/lib/utils/functions/index.d.ts +1 -1
- package/src/lib/utils/functions/isTurnkeyEnabled/index.d.ts +1 -0
- package/src/lib/utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.cjs +10 -0
- package/src/lib/utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.d.ts +2 -0
- package/src/lib/utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.js +6 -0
- package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.cjs +6 -2
- package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.js +6 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +13 -5
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +13 -5
- package/src/lib/views/EmailVerification/EmailVerification.cjs +9 -3
- package/src/lib/views/EmailVerification/EmailVerification.js +9 -3
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +2 -3
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +2 -3
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSimpleSignIn/WalletSimpleSignIn.cjs +1 -4
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSimpleSignIn/WalletSimpleSignIn.js +1 -4
- package/src/lib/views/LoginView/useLoginView.cjs +11 -3
- package/src/lib/views/LoginView/useLoginView.js +11 -3
- package/src/lib/views/WalletGroupView/WalletGroupView.cjs +1 -1
- package/src/lib/views/WalletGroupView/WalletGroupView.js +1 -1
- package/src/lib/views/WalletList/WalletList.cjs +1 -1
- package/src/lib/views/WalletList/WalletList.js +1 -1
- package/src/lib/utils/functions/isPasskeyEmbeddedWalletEnabled/index.d.ts +0 -1
- package/src/lib/utils/functions/isPasskeyEmbeddedWalletEnabled/isPasskeyEmbeddedWalletEnabled.cjs +0 -7
- package/src/lib/utils/functions/isPasskeyEmbeddedWalletEnabled/isPasskeyEmbeddedWalletEnabled.d.ts +0 -2
- package/src/lib/utils/functions/isPasskeyEmbeddedWalletEnabled/isPasskeyEmbeddedWalletEnabled.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
## [0.19.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.16...v0.19.0-alpha.17) (2023-10-19)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* memoize createEmbeddedWallet so sync passkey is not called multiple times ([#3612](https://github.com/dynamic-labs/DynamicAuth/issues/3612)) ([11d53e9](https://github.com/dynamic-labs/DynamicAuth/commit/11d53e9bf3e7c4ceb4be7dede96e6facd07a6767))
|
|
8
|
+
* revert any changes of the form of the wallet connector key ([#3608](https://github.com/dynamic-labs/DynamicAuth/issues/3608)) ([f0e2a89](https://github.com/dynamic-labs/DynamicAuth/commit/f0e2a8988047e7533cbfc52eee06d6752c5aa9c4))
|
|
9
|
+
|
|
2
10
|
## [0.19.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.15...v0.19.0-alpha.16) (2023-10-17)
|
|
3
11
|
|
|
4
12
|
|
package/package.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = "0.19.0-alpha.
|
|
5
|
+
var version = "0.19.0-alpha.17";
|
|
6
6
|
var dependencies = {
|
|
7
7
|
"@dynamic-labs/iconic": "0.1.34",
|
|
8
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
8
|
+
"@dynamic-labs/sdk-api": "0.0.291",
|
|
9
9
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
10
10
|
"country-list": "2.3.0",
|
|
11
11
|
formik: "2.2.9",
|
package/package.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var version = "0.19.0-alpha.
|
|
1
|
+
var version = "0.19.0-alpha.17";
|
|
2
2
|
var dependencies = {
|
|
3
3
|
"@dynamic-labs/iconic": "0.1.34",
|
|
4
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
4
|
+
"@dynamic-labs/sdk-api": "0.0.291",
|
|
5
5
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
6
6
|
"country-list": "2.3.0",
|
|
7
7
|
formik: "2.2.9",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "0.19.0-alpha.
|
|
3
|
+
"version": "0.19.0-alpha.17",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@dynamic-labs/iconic": "0.1.34",
|
|
11
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
11
|
+
"@dynamic-labs/sdk-api": "0.0.291",
|
|
12
12
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
13
13
|
"country-list": "2.3.0",
|
|
14
14
|
"formik": "2.2.9",
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
"react-focus-lock": "2.9.2",
|
|
18
18
|
"react-i18next": "^13.2.0",
|
|
19
19
|
"yup": "0.32.11",
|
|
20
|
-
"@dynamic-labs/logger": "0.19.0-alpha.
|
|
21
|
-
"@dynamic-labs/multi-wallet": "0.19.0-alpha.
|
|
22
|
-
"@dynamic-labs/rpc-providers": "0.19.0-alpha.
|
|
23
|
-
"@dynamic-labs/types": "0.19.0-alpha.
|
|
24
|
-
"@dynamic-labs/utils": "0.19.0-alpha.
|
|
25
|
-
"@dynamic-labs/wallet-book": "0.19.0-alpha.
|
|
26
|
-
"@dynamic-labs/wallet-connector-core": "0.19.0-alpha.
|
|
20
|
+
"@dynamic-labs/logger": "0.19.0-alpha.17",
|
|
21
|
+
"@dynamic-labs/multi-wallet": "0.19.0-alpha.17",
|
|
22
|
+
"@dynamic-labs/rpc-providers": "0.19.0-alpha.17",
|
|
23
|
+
"@dynamic-labs/types": "0.19.0-alpha.17",
|
|
24
|
+
"@dynamic-labs/utils": "0.19.0-alpha.17",
|
|
25
|
+
"@dynamic-labs/wallet-book": "0.19.0-alpha.17",
|
|
26
|
+
"@dynamic-labs/wallet-connector-core": "0.19.0-alpha.17",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
@@ -22,7 +22,7 @@ require('../../config/ApiEndpoint.cjs');
|
|
|
22
22
|
require('@dynamic-labs/multi-wallet');
|
|
23
23
|
require('@dynamic-labs/rpc-providers');
|
|
24
24
|
require('../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs');
|
|
25
|
-
var
|
|
25
|
+
var isTurnkeyEnabled = require('../../utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.cjs');
|
|
26
26
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
27
27
|
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
28
28
|
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
@@ -65,6 +65,7 @@ const SyncPasskeyFlow = () => {
|
|
|
65
65
|
const lastUsedWallet = localStorage.LocalStorage.getFromLS(localStorage$1.LAST_USED_WALLET);
|
|
66
66
|
const { createEmbeddedWallet } = useEmbeddedWallet.useEmbeddedWallet();
|
|
67
67
|
React.useEffect(() => {
|
|
68
|
+
var _a;
|
|
68
69
|
const createWallet = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
69
70
|
try {
|
|
70
71
|
yield createEmbeddedWallet();
|
|
@@ -76,7 +77,8 @@ const SyncPasskeyFlow = () => {
|
|
|
76
77
|
if (!user ||
|
|
77
78
|
isProjectSettingsLoading ||
|
|
78
79
|
!projectSettings ||
|
|
79
|
-
!
|
|
80
|
+
!isTurnkeyEnabled.isTurnkeyEnabled(projectSettings) ||
|
|
81
|
+
!((_a = projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.automaticEmbeddedWalletCreation) ||
|
|
80
82
|
lastUsedWallet !== undefined //untill embedded wallet is generated it's undefined
|
|
81
83
|
) {
|
|
82
84
|
return;
|
|
@@ -88,7 +90,6 @@ const SyncPasskeyFlow = () => {
|
|
|
88
90
|
lastUsedWallet,
|
|
89
91
|
authMode,
|
|
90
92
|
user,
|
|
91
|
-
isPasskeyEmbeddedWalletEnabled.isPasskeyEmbeddedWalletEnabled,
|
|
92
93
|
createEmbeddedWallet,
|
|
93
94
|
]);
|
|
94
95
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
@@ -18,7 +18,7 @@ import '../../config/ApiEndpoint.js';
|
|
|
18
18
|
import '@dynamic-labs/multi-wallet';
|
|
19
19
|
import '@dynamic-labs/rpc-providers';
|
|
20
20
|
import '../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.js';
|
|
21
|
-
import {
|
|
21
|
+
import { isTurnkeyEnabled } from '../../utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.js';
|
|
22
22
|
import '../../context/ErrorContext/ErrorContext.js';
|
|
23
23
|
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
24
24
|
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
@@ -61,6 +61,7 @@ const SyncPasskeyFlow = () => {
|
|
|
61
61
|
const lastUsedWallet = LocalStorage.getFromLS(LAST_USED_WALLET);
|
|
62
62
|
const { createEmbeddedWallet } = useEmbeddedWallet();
|
|
63
63
|
useEffect(() => {
|
|
64
|
+
var _a;
|
|
64
65
|
const createWallet = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
66
|
try {
|
|
66
67
|
yield createEmbeddedWallet();
|
|
@@ -72,7 +73,8 @@ const SyncPasskeyFlow = () => {
|
|
|
72
73
|
if (!user ||
|
|
73
74
|
isProjectSettingsLoading ||
|
|
74
75
|
!projectSettings ||
|
|
75
|
-
!
|
|
76
|
+
!isTurnkeyEnabled(projectSettings) ||
|
|
77
|
+
!((_a = projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.automaticEmbeddedWalletCreation) ||
|
|
76
78
|
lastUsedWallet !== undefined //untill embedded wallet is generated it's undefined
|
|
77
79
|
) {
|
|
78
80
|
return;
|
|
@@ -84,7 +86,6 @@ const SyncPasskeyFlow = () => {
|
|
|
84
86
|
lastUsedWallet,
|
|
85
87
|
authMode,
|
|
86
88
|
user,
|
|
87
|
-
isPasskeyEmbeddedWalletEnabled,
|
|
88
89
|
createEmbeddedWallet,
|
|
89
90
|
]);
|
|
90
91
|
return jsx(Fragment, {});
|
|
@@ -35,7 +35,7 @@ export * from './getActiveOauthCredential';
|
|
|
35
35
|
export * from './getSocialSignInProviderForProviderEnum';
|
|
36
36
|
export * from './getSocialSignInProviderFromString';
|
|
37
37
|
export * from './getOauthLoginUrl';
|
|
38
|
-
export * from './
|
|
38
|
+
export * from './isTurnkeyEnabled';
|
|
39
39
|
export * from './isEmbeddedWalletPresent';
|
|
40
40
|
export * from './findEmbeddedWalletFromVerifiedCredentials';
|
|
41
41
|
export * from './findTurnkeyWallet';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isTurnkeyEnabled } from './isTurnkeyEnabled';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var sdkApi = require('@dynamic-labs/sdk-api');
|
|
6
|
+
var isProviderEnabled = require('../isProviderEnabled/isProviderEnabled.cjs');
|
|
7
|
+
|
|
8
|
+
const isTurnkeyEnabled = (projectSettings) => { var _a; return isProviderEnabled.isProviderEnabled((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _a !== void 0 ? _a : [], sdkApi.ProviderEnum.Turnkey); };
|
|
9
|
+
|
|
10
|
+
exports.isTurnkeyEnabled = isTurnkeyEnabled;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ProviderEnum } from '@dynamic-labs/sdk-api';
|
|
2
|
+
import { isProviderEnabled } from '../isProviderEnabled/isProviderEnabled.js';
|
|
3
|
+
|
|
4
|
+
const isTurnkeyEnabled = (projectSettings) => { var _a; return isProviderEnabled((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) !== null && _a !== void 0 ? _a : [], ProviderEnum.Turnkey); };
|
|
5
|
+
|
|
6
|
+
export { isTurnkeyEnabled };
|
package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.cjs
CHANGED
|
@@ -26,8 +26,12 @@ const groupWalletOptions = (walletBook$1, walletOptionList) => {
|
|
|
26
26
|
return (_a = output[existingGroupIndex].groupedWallets) === null || _a === void 0 ? void 0 : _a.push(currentWalletOption);
|
|
27
27
|
}
|
|
28
28
|
// Validate if there is any other wallet with the same group
|
|
29
|
-
const isThereWalletOptionWithSameGroup = walletOptionList.some((walletOption) =>
|
|
30
|
-
|
|
29
|
+
const isThereWalletOptionWithSameGroup = walletOptionList.some((walletOption) => {
|
|
30
|
+
var _a;
|
|
31
|
+
return currentWalletOption.group === walletOption.group &&
|
|
32
|
+
(((_a = walletOption.injectedConfig) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
33
|
+
currentWalletOption.key !== walletOption.key);
|
|
34
|
+
});
|
|
31
35
|
// Avoid group creation if there only one wallet in group
|
|
32
36
|
if (!isThereWalletOptionWithSameGroup) {
|
|
33
37
|
return output.push(currentWalletOption);
|
package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.js
CHANGED
|
@@ -22,8 +22,12 @@ const groupWalletOptions = (walletBook, walletOptionList) => {
|
|
|
22
22
|
return (_a = output[existingGroupIndex].groupedWallets) === null || _a === void 0 ? void 0 : _a.push(currentWalletOption);
|
|
23
23
|
}
|
|
24
24
|
// Validate if there is any other wallet with the same group
|
|
25
|
-
const isThereWalletOptionWithSameGroup = walletOptionList.some((walletOption) =>
|
|
26
|
-
|
|
25
|
+
const isThereWalletOptionWithSameGroup = walletOptionList.some((walletOption) => {
|
|
26
|
+
var _a;
|
|
27
|
+
return currentWalletOption.group === walletOption.group &&
|
|
28
|
+
(((_a = walletOption.injectedConfig) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
29
|
+
currentWalletOption.key !== walletOption.key);
|
|
30
|
+
});
|
|
27
31
|
// Avoid group creation if there only one wallet in group
|
|
28
32
|
if (!isThereWalletOptionWithSameGroup) {
|
|
29
33
|
return output.push(currentWalletOption);
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
6
|
+
var React = require('react');
|
|
6
7
|
var useInternalDynamicContext = require('../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
7
8
|
var ViewContext = require('../../../context/ViewContext/ViewContext.cjs');
|
|
8
9
|
var decodeJwt = require('../../../shared/utils/functions/decodeJwt/decodeJwt.cjs');
|
|
9
10
|
require('@dynamic-labs/iconic');
|
|
10
11
|
require('@dynamic-labs/wallet-connector-core');
|
|
11
12
|
require('react/jsx-runtime');
|
|
12
|
-
require('react');
|
|
13
13
|
require('../../../shared/logger.cjs');
|
|
14
14
|
require('@dynamic-labs/wallet-book');
|
|
15
15
|
require('@dynamic-labs/utils');
|
|
@@ -20,7 +20,7 @@ require('../../../shared/consts/index.cjs');
|
|
|
20
20
|
require('@dynamic-labs/multi-wallet');
|
|
21
21
|
var getAuthToken = require('../../functions/getAuthToken/getAuthToken.cjs');
|
|
22
22
|
require('@dynamic-labs/sdk-api');
|
|
23
|
-
var
|
|
23
|
+
var isTurnkeyEnabled = require('../../functions/isTurnkeyEnabled/isTurnkeyEnabled.cjs');
|
|
24
24
|
var isEmbeddedWalletPresent = require('../../functions/isEmbeddedWalletPresent/isEmbeddedWalletPresent.cjs');
|
|
25
25
|
var findEmbeddedWalletFromVerifiedCredentials = require('../../functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.cjs');
|
|
26
26
|
var findTurnkeyWallet = require('../../functions/findTurnkeyWallet/findTurnkeyWallet.cjs');
|
|
@@ -37,13 +37,13 @@ const useEmbeddedWallet = () => {
|
|
|
37
37
|
}
|
|
38
38
|
return isEmbeddedWalletPresent.isEmbeddedWalletPresent(jwt);
|
|
39
39
|
};
|
|
40
|
-
const createEmbeddedWallet = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
+
const createEmbeddedWallet = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
41
41
|
var _a, _b, _c, _d;
|
|
42
42
|
const jwt = (_a = getAuthToken.getAuthToken()) !== null && _a !== void 0 ? _a : onboardingOnlyJwt;
|
|
43
43
|
if (!jwt) {
|
|
44
44
|
throw new Error('User is not logged in');
|
|
45
45
|
}
|
|
46
|
-
if (!
|
|
46
|
+
if (!isTurnkeyEnabled.isTurnkeyEnabled(projectSettings)) {
|
|
47
47
|
throw new Error('Passkey embedded wallet is not enabled');
|
|
48
48
|
}
|
|
49
49
|
const embeddedWalletVerifiedCredential = findEmbeddedWalletFromVerifiedCredentials.findEmbeddedWalletFromVerifiedCredentials(jwt);
|
|
@@ -72,7 +72,15 @@ const useEmbeddedWallet = () => {
|
|
|
72
72
|
id: embeddedWalletVerifiedCredential.id,
|
|
73
73
|
};
|
|
74
74
|
return Promise.resolve(passkeyWallet);
|
|
75
|
-
})
|
|
75
|
+
}), [
|
|
76
|
+
internalEvents,
|
|
77
|
+
internalSetShowAuthFlow,
|
|
78
|
+
onboardingOnlyJwt,
|
|
79
|
+
projectSettings,
|
|
80
|
+
setPrimaryWalletId,
|
|
81
|
+
setView,
|
|
82
|
+
wallets,
|
|
83
|
+
]);
|
|
76
84
|
return {
|
|
77
85
|
createEmbeddedWallet,
|
|
78
86
|
userHasEmbeddedWallet,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
|
+
import { useCallback } from 'react';
|
|
2
3
|
import { useInternalDynamicContext } from '../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
3
4
|
import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
4
5
|
import { decodeJwt } from '../../../shared/utils/functions/decodeJwt/decodeJwt.js';
|
|
5
6
|
import '@dynamic-labs/iconic';
|
|
6
7
|
import '@dynamic-labs/wallet-connector-core';
|
|
7
8
|
import 'react/jsx-runtime';
|
|
8
|
-
import 'react';
|
|
9
9
|
import '../../../shared/logger.js';
|
|
10
10
|
import '@dynamic-labs/wallet-book';
|
|
11
11
|
import '@dynamic-labs/utils';
|
|
@@ -16,7 +16,7 @@ import '../../../shared/consts/index.js';
|
|
|
16
16
|
import '@dynamic-labs/multi-wallet';
|
|
17
17
|
import { getAuthToken } from '../../functions/getAuthToken/getAuthToken.js';
|
|
18
18
|
import '@dynamic-labs/sdk-api';
|
|
19
|
-
import {
|
|
19
|
+
import { isTurnkeyEnabled } from '../../functions/isTurnkeyEnabled/isTurnkeyEnabled.js';
|
|
20
20
|
import { isEmbeddedWalletPresent } from '../../functions/isEmbeddedWalletPresent/isEmbeddedWalletPresent.js';
|
|
21
21
|
import { findEmbeddedWalletFromVerifiedCredentials } from '../../functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.js';
|
|
22
22
|
import { findTurnkeyWallet } from '../../functions/findTurnkeyWallet/findTurnkeyWallet.js';
|
|
@@ -33,13 +33,13 @@ const useEmbeddedWallet = () => {
|
|
|
33
33
|
}
|
|
34
34
|
return isEmbeddedWalletPresent(jwt);
|
|
35
35
|
};
|
|
36
|
-
const createEmbeddedWallet = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
const createEmbeddedWallet = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
37
|
var _a, _b, _c, _d;
|
|
38
38
|
const jwt = (_a = getAuthToken()) !== null && _a !== void 0 ? _a : onboardingOnlyJwt;
|
|
39
39
|
if (!jwt) {
|
|
40
40
|
throw new Error('User is not logged in');
|
|
41
41
|
}
|
|
42
|
-
if (!
|
|
42
|
+
if (!isTurnkeyEnabled(projectSettings)) {
|
|
43
43
|
throw new Error('Passkey embedded wallet is not enabled');
|
|
44
44
|
}
|
|
45
45
|
const embeddedWalletVerifiedCredential = findEmbeddedWalletFromVerifiedCredentials(jwt);
|
|
@@ -68,7 +68,15 @@ const useEmbeddedWallet = () => {
|
|
|
68
68
|
id: embeddedWalletVerifiedCredential.id,
|
|
69
69
|
};
|
|
70
70
|
return Promise.resolve(passkeyWallet);
|
|
71
|
-
})
|
|
71
|
+
}), [
|
|
72
|
+
internalEvents,
|
|
73
|
+
internalSetShowAuthFlow,
|
|
74
|
+
onboardingOnlyJwt,
|
|
75
|
+
projectSettings,
|
|
76
|
+
setPrimaryWalletId,
|
|
77
|
+
setView,
|
|
78
|
+
wallets,
|
|
79
|
+
]);
|
|
72
80
|
return {
|
|
73
81
|
createEmbeddedWallet,
|
|
74
82
|
userHasEmbeddedWallet,
|
|
@@ -95,7 +95,7 @@ const EmailVerification = () => {
|
|
|
95
95
|
const { view, setView, goToInitialView } = ViewContext.useViewContext();
|
|
96
96
|
const { error, setError, setErrorMessage } = ErrorContext.useErrorContext();
|
|
97
97
|
const { setExistentAccountData } = AccountExistsContext.useAccountExistsContext();
|
|
98
|
-
const { environmentId, onboardingOnlyJwt, handleLogOut, authToken, setOnboardingOnlyJwt, setShowAuthFlow, setCallback, setIsVerificationInProgress, isVerificationInProgress, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
98
|
+
const { environmentId, onboardingOnlyJwt, handleLogOut, authToken, setOnboardingOnlyJwt, setShowAuthFlow, setCallback, setIsVerificationInProgress, isVerificationInProgress, projectSettings, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
99
99
|
const { email, verificationUUID, setVerificationUUID } = EmailVerificationContext.useEmailVerificationContext();
|
|
100
100
|
const { loading, setLoading } = LoadingContext.useLoadingContext();
|
|
101
101
|
const { createEmbeddedWallet } = useEmbeddedWallet.useEmbeddedWallet();
|
|
@@ -127,6 +127,7 @@ const EmailVerification = () => {
|
|
|
127
127
|
setIsVerificationInProgress(false);
|
|
128
128
|
};
|
|
129
129
|
const handleComplete = React.useCallback((verificationToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
130
|
+
var _a;
|
|
130
131
|
setError(undefined);
|
|
131
132
|
setLoading(true);
|
|
132
133
|
if (!verificationUUID || (!authToken && !onboardingOnlyJwt)) {
|
|
@@ -147,7 +148,9 @@ const EmailVerification = () => {
|
|
|
147
148
|
try {
|
|
148
149
|
// this function will check turnkey wallet enabled and create wallet if needed
|
|
149
150
|
// if not enabled, it will throw an error.
|
|
150
|
-
|
|
151
|
+
if ((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.automaticEmbeddedWalletCreation) {
|
|
152
|
+
yield createEmbeddedWallet();
|
|
153
|
+
}
|
|
151
154
|
}
|
|
152
155
|
catch (e) {
|
|
153
156
|
setShowAuthFlow(false);
|
|
@@ -182,6 +185,7 @@ const EmailVerification = () => {
|
|
|
182
185
|
setView,
|
|
183
186
|
]);
|
|
184
187
|
const handleEmailLogin = React.useCallback((verificationToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
188
|
+
var _b;
|
|
185
189
|
setError(undefined);
|
|
186
190
|
setLoading(true);
|
|
187
191
|
if (!verificationUUID) {
|
|
@@ -215,7 +219,9 @@ const EmailVerification = () => {
|
|
|
215
219
|
try {
|
|
216
220
|
// this function will check turnkey wallet enabled and create wallet if needed
|
|
217
221
|
// if not enabled, it will throw an error.
|
|
218
|
-
|
|
222
|
+
if ((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation) {
|
|
223
|
+
yield createEmbeddedWallet();
|
|
224
|
+
}
|
|
219
225
|
}
|
|
220
226
|
catch (e) {
|
|
221
227
|
setShowAuthFlow(false);
|
|
@@ -91,7 +91,7 @@ const EmailVerification = () => {
|
|
|
91
91
|
const { view, setView, goToInitialView } = useViewContext();
|
|
92
92
|
const { error, setError, setErrorMessage } = useErrorContext();
|
|
93
93
|
const { setExistentAccountData } = useAccountExistsContext();
|
|
94
|
-
const { environmentId, onboardingOnlyJwt, handleLogOut, authToken, setOnboardingOnlyJwt, setShowAuthFlow, setCallback, setIsVerificationInProgress, isVerificationInProgress, } = useInternalDynamicContext();
|
|
94
|
+
const { environmentId, onboardingOnlyJwt, handleLogOut, authToken, setOnboardingOnlyJwt, setShowAuthFlow, setCallback, setIsVerificationInProgress, isVerificationInProgress, projectSettings, } = useInternalDynamicContext();
|
|
95
95
|
const { email, verificationUUID, setVerificationUUID } = useEmailVerificationContext();
|
|
96
96
|
const { loading, setLoading } = useLoadingContext();
|
|
97
97
|
const { createEmbeddedWallet } = useEmbeddedWallet();
|
|
@@ -123,6 +123,7 @@ const EmailVerification = () => {
|
|
|
123
123
|
setIsVerificationInProgress(false);
|
|
124
124
|
};
|
|
125
125
|
const handleComplete = useCallback((verificationToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
126
|
+
var _a;
|
|
126
127
|
setError(undefined);
|
|
127
128
|
setLoading(true);
|
|
128
129
|
if (!verificationUUID || (!authToken && !onboardingOnlyJwt)) {
|
|
@@ -143,7 +144,9 @@ const EmailVerification = () => {
|
|
|
143
144
|
try {
|
|
144
145
|
// this function will check turnkey wallet enabled and create wallet if needed
|
|
145
146
|
// if not enabled, it will throw an error.
|
|
146
|
-
|
|
147
|
+
if ((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.automaticEmbeddedWalletCreation) {
|
|
148
|
+
yield createEmbeddedWallet();
|
|
149
|
+
}
|
|
147
150
|
}
|
|
148
151
|
catch (e) {
|
|
149
152
|
setShowAuthFlow(false);
|
|
@@ -178,6 +181,7 @@ const EmailVerification = () => {
|
|
|
178
181
|
setView,
|
|
179
182
|
]);
|
|
180
183
|
const handleEmailLogin = useCallback((verificationToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
184
|
+
var _b;
|
|
181
185
|
setError(undefined);
|
|
182
186
|
setLoading(true);
|
|
183
187
|
if (!verificationUUID) {
|
|
@@ -211,7 +215,9 @@ const EmailVerification = () => {
|
|
|
211
215
|
try {
|
|
212
216
|
// this function will check turnkey wallet enabled and create wallet if needed
|
|
213
217
|
// if not enabled, it will throw an error.
|
|
214
|
-
|
|
218
|
+
if ((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.automaticEmbeddedWalletCreation) {
|
|
219
|
+
yield createEmbeddedWallet();
|
|
220
|
+
}
|
|
215
221
|
}
|
|
216
222
|
catch (e) {
|
|
217
223
|
setShowAuthFlow(false);
|
|
@@ -20,7 +20,7 @@ require('viem');
|
|
|
20
20
|
require('../../../../shared/consts/index.cjs');
|
|
21
21
|
var useInternalDynamicContext = require('../../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
22
22
|
require('@dynamic-labs/multi-wallet');
|
|
23
|
-
var
|
|
23
|
+
var isTurnkeyEnabled = require('../../../../utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.cjs');
|
|
24
24
|
require('../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
25
25
|
require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
26
26
|
var Input = require('../../../../components/Input/Input.cjs');
|
|
@@ -91,8 +91,7 @@ const LoginEmailForm = ({ isLoading: isExternalLoading, onSubmit, onSubmitError,
|
|
|
91
91
|
}
|
|
92
92
|
try {
|
|
93
93
|
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
94
|
-
if ((isEmailWalletProviderEnabled ||
|
|
95
|
-
isPasskeyEmbeddedWalletEnabled.isPasskeyEmbeddedWalletEnabled(projectSettings)) &&
|
|
94
|
+
if ((isEmailWalletProviderEnabled || isTurnkeyEnabled.isTurnkeyEnabled(projectSettings)) &&
|
|
96
95
|
(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.confirmEmailProviderForVerify)) {
|
|
97
96
|
// see: https://linear.app/dynamic-labs/issue/DYN-2517
|
|
98
97
|
// if confirmWalletTransfers setting is true, check api first to confirm emailProvider
|
|
@@ -16,7 +16,7 @@ import 'viem';
|
|
|
16
16
|
import '../../../../shared/consts/index.js';
|
|
17
17
|
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
18
18
|
import '@dynamic-labs/multi-wallet';
|
|
19
|
-
import {
|
|
19
|
+
import { isTurnkeyEnabled } from '../../../../utils/functions/isTurnkeyEnabled/isTurnkeyEnabled.js';
|
|
20
20
|
import '../../../../components/ShadowDOM/ShadowDOM.js';
|
|
21
21
|
import '../../../../context/ThemeContext/ThemeContext.js';
|
|
22
22
|
import { Input } from '../../../../components/Input/Input.js';
|
|
@@ -87,8 +87,7 @@ const LoginEmailForm = ({ isLoading: isExternalLoading, onSubmit, onSubmitError,
|
|
|
87
87
|
}
|
|
88
88
|
try {
|
|
89
89
|
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
90
|
-
if ((isEmailWalletProviderEnabled ||
|
|
91
|
-
isPasskeyEmbeddedWalletEnabled(projectSettings)) &&
|
|
90
|
+
if ((isEmailWalletProviderEnabled || isTurnkeyEnabled(projectSettings)) &&
|
|
92
91
|
(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.confirmEmailProviderForVerify)) {
|
|
93
92
|
// see: https://linear.app/dynamic-labs/issue/DYN-2517
|
|
94
93
|
// if confirmWalletTransfers setting is true, check api first to confirm emailProvider
|
|
@@ -43,10 +43,7 @@ const WalletSimpleSignIn = ({ previewWalletsNumber, disabled = false, onshowAllW
|
|
|
43
43
|
walletsFilter,
|
|
44
44
|
});
|
|
45
45
|
const isUsingMultiWallet = Boolean(localStorage.LocalStorage.getFromLS(localStorage$1.AUTH_USER));
|
|
46
|
-
return !projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { count: previewWalletsNumber + 1, className: 'login-with-email-wallet-list__skeleton' })) : (jsxRuntime.jsxs("div", { className: 'login-with-email-wallet-list__container', "data-testid": 'top-wallets-list', children: [walletsList.map((wallet) => {
|
|
47
|
-
var _a;
|
|
48
|
-
return (jsxRuntime.jsx(WalletListItem.WalletListItem, { wallet: wallet, usingMultiWallet: isUsingMultiWallet, disabled: disabled }, wallet.key + ((_a = wallet.groupedWallets) === null || _a === void 0 ? void 0 : _a.length)));
|
|
49
|
-
}), jsxRuntime.jsx(ListItemButton.ListItemButton, { text: t('dyn_wallet_list.view_all'), onClick: onshowAllWallets, numberOfWallets: numberOfWallets, disabled: disabled })] }));
|
|
46
|
+
return !projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { count: previewWalletsNumber + 1, className: 'login-with-email-wallet-list__skeleton' })) : (jsxRuntime.jsxs("div", { className: 'login-with-email-wallet-list__container', "data-testid": 'top-wallets-list', children: [walletsList.map((wallet, index) => (jsxRuntime.jsx(WalletListItem.WalletListItem, { wallet: wallet, usingMultiWallet: isUsingMultiWallet, disabled: disabled }, `${wallet.key}_${index}`))), jsxRuntime.jsx(ListItemButton.ListItemButton, { text: t('dyn_wallet_list.view_all'), onClick: onshowAllWallets, numberOfWallets: numberOfWallets, disabled: disabled })] }));
|
|
50
47
|
};
|
|
51
48
|
|
|
52
49
|
exports.WalletSimpleSignIn = WalletSimpleSignIn;
|
|
@@ -39,10 +39,7 @@ const WalletSimpleSignIn = ({ previewWalletsNumber, disabled = false, onshowAllW
|
|
|
39
39
|
walletsFilter,
|
|
40
40
|
});
|
|
41
41
|
const isUsingMultiWallet = Boolean(LocalStorage.getFromLS(AUTH_USER));
|
|
42
|
-
return !projectSettings ? (jsx(Skeleton, { count: previewWalletsNumber + 1, className: 'login-with-email-wallet-list__skeleton' })) : (jsxs("div", { className: 'login-with-email-wallet-list__container', "data-testid": 'top-wallets-list', children: [walletsList.map((wallet) => {
|
|
43
|
-
var _a;
|
|
44
|
-
return (jsx(WalletListItem, { wallet: wallet, usingMultiWallet: isUsingMultiWallet, disabled: disabled }, wallet.key + ((_a = wallet.groupedWallets) === null || _a === void 0 ? void 0 : _a.length)));
|
|
45
|
-
}), jsx(ListItemButton, { text: t('dyn_wallet_list.view_all'), onClick: onshowAllWallets, numberOfWallets: numberOfWallets, disabled: disabled })] }));
|
|
42
|
+
return !projectSettings ? (jsx(Skeleton, { count: previewWalletsNumber + 1, className: 'login-with-email-wallet-list__skeleton' })) : (jsxs("div", { className: 'login-with-email-wallet-list__container', "data-testid": 'top-wallets-list', children: [walletsList.map((wallet, index) => (jsx(WalletListItem, { wallet: wallet, usingMultiWallet: isUsingMultiWallet, disabled: disabled }, `${wallet.key}_${index}`))), jsx(ListItemButton, { text: t('dyn_wallet_list.view_all'), onClick: onshowAllWallets, numberOfWallets: numberOfWallets, disabled: disabled })] }));
|
|
46
43
|
};
|
|
47
44
|
|
|
48
45
|
export { WalletSimpleSignIn };
|
|
@@ -21,9 +21,17 @@ require('@dynamic-labs/multi-wallet');
|
|
|
21
21
|
var isEmailProviderEnabled = require('../../utils/functions/isEmailProviderEnabled/isEmailProviderEnabled.cjs');
|
|
22
22
|
var index = require('../../utils/functions/getEnabledProviders/index.cjs');
|
|
23
23
|
|
|
24
|
+
/* eslint-disable multiline-comment-style */
|
|
24
25
|
const NUMBER_OF_WALLETS = 3;
|
|
25
26
|
const useLoginView = () => {
|
|
26
27
|
const { projectSettings, authorizationViewDisplayOrder, loginWithEmail, wallets, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
28
|
+
/** Takes from wallets only those that can be selected in the wallet list by the user.
|
|
29
|
+
* Should filter out embedded wallets
|
|
30
|
+
* WHY: when we decide whether to show wallets or not, we need to know how many wallets
|
|
31
|
+
* will actually be rendered. It would be especially bad to only have for ex "turnkey" in
|
|
32
|
+
* wallets and then display an empty wallet list (since turnkey doesn't render)
|
|
33
|
+
*/
|
|
34
|
+
const selectableWallets = wallets.filter(({ key }) => key !== 'turnkey');
|
|
27
35
|
const { t } = reactI18next.useTranslation();
|
|
28
36
|
const hasEnabledProviders = Boolean(index.getEnabledProviders(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers).length);
|
|
29
37
|
const isWalletOnly = React.useMemo(() => {
|
|
@@ -81,7 +89,7 @@ const useLoginView = () => {
|
|
|
81
89
|
* @returns
|
|
82
90
|
*/
|
|
83
91
|
const filterLoginViewSections = (sections) => {
|
|
84
|
-
if (
|
|
92
|
+
if (selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length) {
|
|
85
93
|
return sections;
|
|
86
94
|
}
|
|
87
95
|
return sections.filter((section) => section.type !== 'wallet');
|
|
@@ -90,7 +98,7 @@ const useLoginView = () => {
|
|
|
90
98
|
// if not the first index, no separator is needed
|
|
91
99
|
// if the first index but does not have wallets or providers,
|
|
92
100
|
// it'll show only one view section - no separator is needed
|
|
93
|
-
if (index !== 0 || !(
|
|
101
|
+
if (index !== 0 || !(selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length) || !hasEnabledProviders) {
|
|
94
102
|
return [];
|
|
95
103
|
}
|
|
96
104
|
return [
|
|
@@ -115,7 +123,7 @@ const useLoginView = () => {
|
|
|
115
123
|
// add separator if wallets defined
|
|
116
124
|
addSeparator(index));
|
|
117
125
|
}
|
|
118
|
-
if (loginItem === 'wallet' && (
|
|
126
|
+
if (loginItem === 'wallet' && (selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length)) {
|
|
119
127
|
// if showWalletsButton is true, it should show "Connec with Wallet" button
|
|
120
128
|
const numOfItemsToDisplay = ((_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _a === void 0 ? void 0 : _a.modal) === null || _b === void 0 ? void 0 : _b.showWalletsButton)
|
|
121
129
|
? 0
|
|
@@ -17,9 +17,17 @@ import '@dynamic-labs/multi-wallet';
|
|
|
17
17
|
import { isEmailProviderEnabled } from '../../utils/functions/isEmailProviderEnabled/isEmailProviderEnabled.js';
|
|
18
18
|
import { getEnabledProviders } from '../../utils/functions/getEnabledProviders/index.js';
|
|
19
19
|
|
|
20
|
+
/* eslint-disable multiline-comment-style */
|
|
20
21
|
const NUMBER_OF_WALLETS = 3;
|
|
21
22
|
const useLoginView = () => {
|
|
22
23
|
const { projectSettings, authorizationViewDisplayOrder, loginWithEmail, wallets, } = useInternalDynamicContext();
|
|
24
|
+
/** Takes from wallets only those that can be selected in the wallet list by the user.
|
|
25
|
+
* Should filter out embedded wallets
|
|
26
|
+
* WHY: when we decide whether to show wallets or not, we need to know how many wallets
|
|
27
|
+
* will actually be rendered. It would be especially bad to only have for ex "turnkey" in
|
|
28
|
+
* wallets and then display an empty wallet list (since turnkey doesn't render)
|
|
29
|
+
*/
|
|
30
|
+
const selectableWallets = wallets.filter(({ key }) => key !== 'turnkey');
|
|
23
31
|
const { t } = useTranslation();
|
|
24
32
|
const hasEnabledProviders = Boolean(getEnabledProviders(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers).length);
|
|
25
33
|
const isWalletOnly = useMemo(() => {
|
|
@@ -77,7 +85,7 @@ const useLoginView = () => {
|
|
|
77
85
|
* @returns
|
|
78
86
|
*/
|
|
79
87
|
const filterLoginViewSections = (sections) => {
|
|
80
|
-
if (
|
|
88
|
+
if (selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length) {
|
|
81
89
|
return sections;
|
|
82
90
|
}
|
|
83
91
|
return sections.filter((section) => section.type !== 'wallet');
|
|
@@ -86,7 +94,7 @@ const useLoginView = () => {
|
|
|
86
94
|
// if not the first index, no separator is needed
|
|
87
95
|
// if the first index but does not have wallets or providers,
|
|
88
96
|
// it'll show only one view section - no separator is needed
|
|
89
|
-
if (index !== 0 || !(
|
|
97
|
+
if (index !== 0 || !(selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length) || !hasEnabledProviders) {
|
|
90
98
|
return [];
|
|
91
99
|
}
|
|
92
100
|
return [
|
|
@@ -111,7 +119,7 @@ const useLoginView = () => {
|
|
|
111
119
|
// add separator if wallets defined
|
|
112
120
|
addSeparator(index));
|
|
113
121
|
}
|
|
114
|
-
if (loginItem === 'wallet' && (
|
|
122
|
+
if (loginItem === 'wallet' && (selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length)) {
|
|
115
123
|
// if showWalletsButton is true, it should show "Connec with Wallet" button
|
|
116
124
|
const numOfItemsToDisplay = ((_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _a === void 0 ? void 0 : _a.modal) === null || _b === void 0 ? void 0 : _b.showWalletsButton)
|
|
117
125
|
? 0
|
|
@@ -15,7 +15,7 @@ const WalletGroupView = () => {
|
|
|
15
15
|
if (!selectedWalletGroup)
|
|
16
16
|
throw new Error('Could not access WalletGroup view without selected group');
|
|
17
17
|
const walletBookData = walletBook.getWalletGroup(walletBook$1, selectedWalletGroup === null || selectedWalletGroup === void 0 ? void 0 : selectedWalletGroup.key);
|
|
18
|
-
return (jsxRuntime.jsx(SelectWalletChainLayout.SelectWalletChainLayout, { HeaderIcon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: (_a = walletBookData.brand) === null || _a === void 0 ? void 0 : _a.spriteId }), children: selectedWalletGroup.groupedWallets.map((wallet) => (jsxRuntime.jsx(WalletGroupItem.WalletGroupItem, { wallet: wallet }, wallet.key))) }));
|
|
18
|
+
return (jsxRuntime.jsx(SelectWalletChainLayout.SelectWalletChainLayout, { HeaderIcon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: (_a = walletBookData.brand) === null || _a === void 0 ? void 0 : _a.spriteId }), children: selectedWalletGroup.groupedWallets.map((wallet, index) => (jsxRuntime.jsx(WalletGroupItem.WalletGroupItem, { wallet: wallet }, `${wallet.key}_${index}`))) }));
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
exports.WalletGroupView = WalletGroupView;
|
|
@@ -11,7 +11,7 @@ const WalletGroupView = () => {
|
|
|
11
11
|
if (!selectedWalletGroup)
|
|
12
12
|
throw new Error('Could not access WalletGroup view without selected group');
|
|
13
13
|
const walletBookData = getWalletGroup(walletBook, selectedWalletGroup === null || selectedWalletGroup === void 0 ? void 0 : selectedWalletGroup.key);
|
|
14
|
-
return (jsx(SelectWalletChainLayout, { HeaderIcon: jsx(WalletIcon, { walletKey: (_a = walletBookData.brand) === null || _a === void 0 ? void 0 : _a.spriteId }), children: selectedWalletGroup.groupedWallets.map((wallet) => (jsx(WalletGroupItem, { wallet: wallet }, wallet.key))) }));
|
|
14
|
+
return (jsx(SelectWalletChainLayout, { HeaderIcon: jsx(WalletIcon, { walletKey: (_a = walletBookData.brand) === null || _a === void 0 ? void 0 : _a.spriteId }), children: selectedWalletGroup.groupedWallets.map((wallet, index) => (jsx(WalletGroupItem, { wallet: wallet }, `${wallet.key}_${index}`))) }));
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export { WalletGroupView };
|
|
@@ -80,7 +80,7 @@ const WalletList = ({ isWalletConnectList = false, }) => {
|
|
|
80
80
|
};
|
|
81
81
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: 'wallet-list__container', children: [error && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }), !projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { className: 'wallet-list__search-skeleton' })) : (isSearchEnabled && (jsxRuntime.jsx(Search.Search, { label: `Search through ${numberOfWallets} wallets...`, value: filterValue, onChange: ({ target: { value } }) => handleFilterValueChange(value), onClickClear: () => handleFilterValueChange('') }))), jsxRuntime.jsxs("div", { className: classNames.classNames('wallet-list__scroll-container', {
|
|
82
82
|
'wallet-list__scroll-container--full-height': isSearchEnabled,
|
|
83
|
-
}), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll, children: [!projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [wallets.length === 0 && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: "Oops, no login methods have been configured." })), wallets.length && walletsList.length === 0 ? (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, { title: 'No wallet found.', subtitle: 'Try searching for a different wallet', image: jsxRuntime.jsx(noWalletFound.ReactComponent, {}) })) : (walletsList.map((wallet) => (jsxRuntime.jsx(WalletListItem.WalletListItem, { wallet: wallet, usingMultiWallet: multiWallet, onResetSearchValue: () => handleFilterValueChange('') }, wallet.key))))] })), isSearchEnabled && !filterValue && projectSettings && (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, {}))] })] }), noDefaultFooter && (jsxRuntime.jsx("div", { className: classNames.classNames('wallet-list__tiny-footer', {
|
|
83
|
+
}), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll, children: [!projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [wallets.length === 0 && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: "Oops, no login methods have been configured." })), wallets.length && walletsList.length === 0 ? (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, { title: 'No wallet found.', subtitle: 'Try searching for a different wallet', image: jsxRuntime.jsx(noWalletFound.ReactComponent, {}) })) : (walletsList.map((wallet, index) => (jsxRuntime.jsx(WalletListItem.WalletListItem, { wallet: wallet, usingMultiWallet: multiWallet, onResetSearchValue: () => handleFilterValueChange('') }, `${wallet.key}_${index}`))))] })), isSearchEnabled && !filterValue && projectSettings && (jsxRuntime.jsx(SearchNotFoundMessage.SearchNotFoundMessage, {}))] })] }), noDefaultFooter && (jsxRuntime.jsx("div", { className: classNames.classNames('wallet-list__tiny-footer', {
|
|
84
84
|
'wallet-list__tiny-footer--hidden': footerIsVisible,
|
|
85
85
|
}), "data-testid": 'wallet-list-tiny-footer' }))] }));
|
|
86
86
|
};
|
|
@@ -76,7 +76,7 @@ const WalletList = ({ isWalletConnectList = false, }) => {
|
|
|
76
76
|
};
|
|
77
77
|
return (jsxs(Fragment, { children: [jsxs("div", { className: 'wallet-list__container', children: [error && jsx(ErrorContainer, { children: error }), !projectSettings ? (jsx(Skeleton, { className: 'wallet-list__search-skeleton' })) : (isSearchEnabled && (jsx(Search, { label: `Search through ${numberOfWallets} wallets...`, value: filterValue, onChange: ({ target: { value } }) => handleFilterValueChange(value), onClickClear: () => handleFilterValueChange('') }))), jsxs("div", { className: classNames('wallet-list__scroll-container', {
|
|
78
78
|
'wallet-list__scroll-container--full-height': isSearchEnabled,
|
|
79
|
-
}), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll, children: [!projectSettings ? (jsx(Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxs(Fragment, { children: [wallets.length === 0 && (jsx(ErrorContainer, { children: "Oops, no login methods have been configured." })), wallets.length && walletsList.length === 0 ? (jsx(SearchNotFoundMessage, { title: 'No wallet found.', subtitle: 'Try searching for a different wallet', image: jsx(SvgNoWalletFound, {}) })) : (walletsList.map((wallet) => (jsx(WalletListItem, { wallet: wallet, usingMultiWallet: multiWallet, onResetSearchValue: () => handleFilterValueChange('') }, wallet.key))))] })), isSearchEnabled && !filterValue && projectSettings && (jsx(SearchNotFoundMessage, {}))] })] }), noDefaultFooter && (jsx("div", { className: classNames('wallet-list__tiny-footer', {
|
|
79
|
+
}), "data-testid": 'wallet-list-scroll-container', ref: walletListScrollRef, onScroll: handleScroll, children: [!projectSettings ? (jsx(Skeleton, { count: 10, className: 'wallet-list__tile-skeleton' })) : (jsxs(Fragment, { children: [wallets.length === 0 && (jsx(ErrorContainer, { children: "Oops, no login methods have been configured." })), wallets.length && walletsList.length === 0 ? (jsx(SearchNotFoundMessage, { title: 'No wallet found.', subtitle: 'Try searching for a different wallet', image: jsx(SvgNoWalletFound, {}) })) : (walletsList.map((wallet, index) => (jsx(WalletListItem, { wallet: wallet, usingMultiWallet: multiWallet, onResetSearchValue: () => handleFilterValueChange('') }, `${wallet.key}_${index}`))))] })), isSearchEnabled && !filterValue && projectSettings && (jsx(SearchNotFoundMessage, {}))] })] }), noDefaultFooter && (jsx("div", { className: classNames('wallet-list__tiny-footer', {
|
|
80
80
|
'wallet-list__tiny-footer--hidden': footerIsVisible,
|
|
81
81
|
}), "data-testid": 'wallet-list-tiny-footer' }))] }));
|
|
82
82
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { isPasskeyEmbeddedWalletEnabled } from './isPasskeyEmbeddedWalletEnabled';
|
package/src/lib/utils/functions/isPasskeyEmbeddedWalletEnabled/isPasskeyEmbeddedWalletEnabled.cjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const isPasskeyEmbeddedWalletEnabled = (projectSettings) => { var _a; return (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.passkeyEmbeddedWalletEnabled) !== null && _a !== void 0 ? _a : false; };
|
|
6
|
-
|
|
7
|
-
exports.isPasskeyEmbeddedWalletEnabled = isPasskeyEmbeddedWalletEnabled;
|
package/src/lib/utils/functions/isPasskeyEmbeddedWalletEnabled/isPasskeyEmbeddedWalletEnabled.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const isPasskeyEmbeddedWalletEnabled = (projectSettings) => { var _a; return (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.passkeyEmbeddedWalletEnabled) !== null && _a !== void 0 ? _a : false; };
|
|
2
|
-
|
|
3
|
-
export { isPasskeyEmbeddedWalletEnabled };
|