@dynamic-labs/sdk-react-core 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +13 -13
- package/src/lib/context/ConnectWithOtpContext/ConnectWithOtpProvider.cjs +1 -1
- package/src/lib/context/ConnectWithOtpContext/ConnectWithOtpProvider.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +2 -0
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +17 -16
- package/src/lib/context/DynamicContext/DynamicContext.js +2 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.cjs +11 -3
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.js +11 -3
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.types.d.ts +1 -0
- package/src/lib/context/DynamicContext/types/index.d.ts +41 -40
- package/src/lib/context/FundingContext/FundingContext.cjs +1 -1
- package/src/lib/context/FundingContext/FundingContext.js +1 -1
- package/src/lib/context/FundingContext/useFunding/useFunding.cjs +1 -1
- package/src/lib/context/FundingContext/useFunding/useFunding.js +1 -1
- package/src/lib/data/api/email/email.cjs +5 -5
- package/src/lib/data/api/email/email.d.ts +2 -2
- package/src/lib/data/api/email/email.js +5 -5
- package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +14 -14
- package/src/lib/data/api/embeddedWallets/embeddedWallets.js +14 -14
- package/src/lib/data/api/oauth/oauth.cjs +6 -6
- package/src/lib/data/api/oauth/oauth.js +6 -6
- package/src/lib/data/api/onramp/onramp.cjs +1 -1
- package/src/lib/data/api/onramp/onramp.d.ts +2 -2
- package/src/lib/data/api/onramp/onramp.js +1 -1
- package/src/lib/data/api/session/session.cjs +2 -2
- package/src/lib/data/api/session/session.js +2 -2
- package/src/lib/data/api/sms/sms.cjs +6 -6
- package/src/lib/data/api/sms/sms.d.ts +2 -2
- package/src/lib/data/api/sms/sms.js +6 -6
- package/src/lib/data/api/user/user.cjs +1 -1
- package/src/lib/data/api/user/user.js +1 -1
- package/src/lib/data/api/wallets/wallets.cjs +5 -5
- package/src/lib/data/api/wallets/wallets.js +5 -5
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/NewToWeb3WalletItem/NewToWeb3WalletItem.d.ts +1 -1
- package/src/lib/shared/utils/hooks/useForwardedRef/useForwardedRef.d.ts +1 -1
- package/src/lib/shared/utils/hooks/useLocalStorage/useLocalStorage.d.ts +1 -1
- package/src/lib/shared/utils/hooks/useThrottle/useThrottle.d.ts +1 -1
- package/src/lib/utils/constants/values.cjs +1 -1
- package/src/lib/utils/constants/values.js +1 -1
- package/src/lib/utils/functions/getSiweStatement/getSiweStatement.d.ts +1 -1
- package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.d.ts +4 -4
- package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.cjs +1 -1
- package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.js +1 -1
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.cjs +1 -1
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.js +1 -1
- package/src/lib/utils/functions/isWalletConnected/isWalletConnected.cjs +1 -1
- package/src/lib/utils/functions/isWalletConnected/isWalletConnected.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +3 -3
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +3 -3
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +4 -4
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +4 -4
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +1 -1
- package/src/lib/utils/hooks/events/useWalletConnectorEvent/useWalletConnectorEvent.d.ts +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +19 -17
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +19 -17
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +4 -4
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +4 -4
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs +1 -1
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js +1 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +4 -4
- package/src/lib/utils/hooks/useEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.d.ts +5 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +4 -4
- package/src/lib/utils/hooks/useHandleVerificationRequired/useHandleVerificationRequired.cjs +1 -1
- package/src/lib/utils/hooks/useHandleVerificationRequired/useHandleVerificationRequired.js +1 -1
- package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.d.ts +1 -1
- package/src/lib/utils/hooks/useInitEmbeddedWalletAuthMethod/useInitEmbeddedWalletAuthMethod.cjs +4 -4
- package/src/lib/utils/hooks/useInitEmbeddedWalletAuthMethod/useInitEmbeddedWalletAuthMethod.js +4 -4
- package/src/lib/utils/hooks/usePromise/usePromise.d.ts +1 -1
- package/src/lib/utils/hooks/usePromise/utils/resolveFetcher/resolveFetcher.cjs +1 -1
- package/src/lib/utils/hooks/usePromise/utils/resolveFetcher/resolveFetcher.js +1 -1
- package/src/lib/utils/hooks/useResizeObserver/useResizeObserver.d.ts +1 -1
- package/src/lib/utils/hooks/useSocialAuth/farcaster.cjs +1 -1
- package/src/lib/utils/hooks/useSocialAuth/farcaster.d.ts +1 -0
- package/src/lib/utils/hooks/useSocialAuth/farcaster.js +1 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +11 -10
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.d.ts +2 -2
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +11 -10
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.cjs +1 -1
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUserWithModal/useUpdateUserWithModal.js +1 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +4 -4
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +4 -4
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.cjs +1 -1
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.js +1 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +2 -2
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +2 -2
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +7 -7
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.d.ts +3 -3
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +7 -7
- package/src/lib/views/Passkey/utils/createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.cjs +3 -3
- package/src/lib/views/Passkey/utils/createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.js +3 -3
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.cjs +1 -1
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.js +1 -1
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +23 -23
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.d.ts +2 -2
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +23 -23
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/components/WalletIconWithNetwork/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.cjs +2 -6
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.js +2 -6
|
@@ -14,7 +14,7 @@ import '../../../shared/utils/classes/storage/localStorage.js';
|
|
|
14
14
|
import '../../../shared/consts/index.js';
|
|
15
15
|
import { sdkApi } from '../api.js';
|
|
16
16
|
|
|
17
|
-
const linkWallet = (environmentId, { messageToSign, network, signedMessage, publicWalletAddress, chain, walletName, walletProvider, additionalWalletAddresses, backup, password, passwordSource, }, userJwt)
|
|
17
|
+
const linkWallet = (environmentId_1, _a, userJwt_1) => __awaiter(void 0, [environmentId_1, _a, userJwt_1], void 0, function* (environmentId, { messageToSign, network, signedMessage, publicWalletAddress, chain, walletName, walletProvider, additionalWalletAddresses, backup, password, passwordSource, }, userJwt) {
|
|
18
18
|
const verifyRequest = VerifyRequestFromJSON({
|
|
19
19
|
additionalWalletAddresses,
|
|
20
20
|
backup,
|
|
@@ -45,7 +45,7 @@ const linkWallet = (environmentId, { messageToSign, network, signedMessage, publ
|
|
|
45
45
|
return undefined;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
const unlinkWallet = (
|
|
48
|
+
const unlinkWallet = (_b, userJwt_2) => __awaiter(void 0, [_b, userJwt_2], void 0, function* ({ environmentId, primaryWalletId, walletId, }, userJwt) {
|
|
49
49
|
try {
|
|
50
50
|
const response = yield sdkApi(userJwt).verifyUnlink({
|
|
51
51
|
environmentId,
|
|
@@ -60,7 +60,7 @@ const unlinkWallet = ({ environmentId, primaryWalletId, walletId, }, userJwt) =>
|
|
|
60
60
|
return undefined;
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
-
const transferWallet = (environmentId, { network, messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, skipEmptyAccountCheck = false, }, userJwt)
|
|
63
|
+
const transferWallet = (environmentId_2, _c, userJwt_3) => __awaiter(void 0, [environmentId_2, _c, userJwt_3], void 0, function* (environmentId, { network, messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, skipEmptyAccountCheck = false, }, userJwt) {
|
|
64
64
|
// We should find a better way to do this than force type casting
|
|
65
65
|
const verifyRequest = {
|
|
66
66
|
chain,
|
|
@@ -79,11 +79,11 @@ const transferWallet = (environmentId, { network, messageToSign, signedMessage,
|
|
|
79
79
|
});
|
|
80
80
|
return response;
|
|
81
81
|
}
|
|
82
|
-
catch (
|
|
82
|
+
catch (_d) {
|
|
83
83
|
return undefined;
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
|
-
const verifyWallet = (environmentId, { messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, captchaToken, network, oauth, additionalWalletAddresses, })
|
|
86
|
+
const verifyWallet = (environmentId_3, _e) => __awaiter(void 0, [environmentId_3, _e], void 0, function* (environmentId, { messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, captchaToken, network, oauth, additionalWalletAddresses, }) {
|
|
87
87
|
const verifyRequest = VerifyRequestFromJSON({
|
|
88
88
|
additionalWalletAddresses,
|
|
89
89
|
captchaToken,
|
|
@@ -2,6 +2,6 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { WalletOption } from '../../../../../shared';
|
|
3
3
|
export declare const NewToWeb3WalletItem: ({ children, style, wallet, }: {
|
|
4
4
|
children?: ReactNode;
|
|
5
|
-
style?: Record<string, unknown
|
|
5
|
+
style?: Record<string, unknown>;
|
|
6
6
|
wallet: WalletOption;
|
|
7
7
|
}) => JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const useForwardedRef: <T>(ref:
|
|
2
|
+
export declare const useForwardedRef: <T>(ref: React.ForwardedRef<T>) => import("react").RefObject<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useLocalStorage: <T>(key: string, initialValue: T, valueValidator?: (
|
|
1
|
+
export declare const useLocalStorage: <T>(key: string, initialValue: T, valueValidator?: (data: T) => boolean, otherKeysToRemove?: string[]) => readonly [T, (value: T | ((val: T) => T)) => void, () => void];
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* @param delay - The time in milliseconds to wait before the next call.
|
|
6
6
|
* @returns A throttled version of the callback function.
|
|
7
7
|
*/
|
|
8
|
-
export declare const useThrottle: <T extends (...args: any[]) => void>(callback: T, delay: number) => (...args: Parameters<T>) => void;
|
|
8
|
+
export declare const useThrottle: <T extends (...args: any[]) => void>(callback: T, delay: number) => ((...args: Parameters<T>) => void);
|
|
@@ -10,7 +10,7 @@ const DEFAULT_NUMBER_OF_WALLETS_TO_SHOW = 10;
|
|
|
10
10
|
// https://github.com/jaredhanson/id-blockchain-claims-in-jwt/blob/main/draft.md
|
|
11
11
|
const ChainEnumToVerifiedCredentialName = {
|
|
12
12
|
ALGO: 'algorand',
|
|
13
|
-
BTC: 'bip122',
|
|
13
|
+
BTC: 'bip122', // see: https://namespaces.chainagnostic.org/bip122/caip2
|
|
14
14
|
COSMOS: 'cosmos',
|
|
15
15
|
ETH: 'eip155',
|
|
16
16
|
EVM: 'eip155',
|
|
@@ -6,7 +6,7 @@ const DEFAULT_NUMBER_OF_WALLETS_TO_SHOW = 10;
|
|
|
6
6
|
// https://github.com/jaredhanson/id-blockchain-claims-in-jwt/blob/main/draft.md
|
|
7
7
|
const ChainEnumToVerifiedCredentialName = {
|
|
8
8
|
ALGO: 'algorand',
|
|
9
|
-
BTC: 'bip122',
|
|
9
|
+
BTC: 'bip122', // see: https://namespaces.chainagnostic.org/bip122/caip2
|
|
10
10
|
COSMOS: 'cosmos',
|
|
11
11
|
ETH: 'eip155',
|
|
12
12
|
EVM: 'eip155',
|
|
@@ -14,8 +14,8 @@ export declare const getEditableUserProfileFields: (projectSettings?: ProjectSet
|
|
|
14
14
|
* @returns {ProjectSettingsKyc[]} - The list of non-editable user profile fields based on project settings.
|
|
15
15
|
*/
|
|
16
16
|
export declare const getNonEditableUserProfileFields: ({ projectSettingsKyc, user, }: {
|
|
17
|
-
projectSettingsKyc?: ProjectSettingsKyc[]
|
|
18
|
-
user?: UserFields
|
|
17
|
+
projectSettingsKyc?: ProjectSettingsKyc[];
|
|
18
|
+
user?: UserFields;
|
|
19
19
|
}) => ProjectSettingsKyc[];
|
|
20
20
|
/**
|
|
21
21
|
* Get all user profile fields that exist in the user profile and are defined in the project
|
|
@@ -25,6 +25,6 @@ export declare const getNonEditableUserProfileFields: ({ projectSettingsKyc, use
|
|
|
25
25
|
* @returns {ProjectSettingsKyc[]} - The list of all user profile fields based on project settings.
|
|
26
26
|
*/
|
|
27
27
|
export declare const getUserProfileFields: ({ projectSettingsKyc, user, }: {
|
|
28
|
-
projectSettingsKyc?: ProjectSettingsKyc[]
|
|
29
|
-
user?: UserProfile
|
|
28
|
+
projectSettingsKyc?: ProjectSettingsKyc[];
|
|
29
|
+
user?: UserProfile;
|
|
30
30
|
}) => ProjectSettingsKyc[];
|
|
@@ -6,7 +6,7 @@ var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
|
6
6
|
var index = require('../generateMessages/index.cjs');
|
|
7
7
|
|
|
8
8
|
// TODO - This function is doing too much we should split it up.
|
|
9
|
-
const getVerifyArgs = ({ walletConnector, nonce, walletProvider, environmentId, displaySiweStatement, skipEmptyAccountCheck, siweStatement, publicWalletAddress, signedMessageOverride, messageToSignOverride, })
|
|
9
|
+
const getVerifyArgs = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ walletConnector, nonce, walletProvider, environmentId, displaySiweStatement, skipEmptyAccountCheck, siweStatement, publicWalletAddress, signedMessageOverride, messageToSignOverride, }) {
|
|
10
10
|
// WARNING - PLEASE READ!
|
|
11
11
|
// DO NOT ADD ANY NEW ASYNC WORK WITH AWAIT!
|
|
12
12
|
// Deep linking could break with too many blocking awaits
|
|
@@ -2,7 +2,7 @@ import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
|
2
2
|
import { generateMessages } from '../generateMessages/index.js';
|
|
3
3
|
|
|
4
4
|
// TODO - This function is doing too much we should split it up.
|
|
5
|
-
const getVerifyArgs = ({ walletConnector, nonce, walletProvider, environmentId, displaySiweStatement, skipEmptyAccountCheck, siweStatement, publicWalletAddress, signedMessageOverride, messageToSignOverride, })
|
|
5
|
+
const getVerifyArgs = (_a) => __awaiter(void 0, [_a], void 0, function* ({ walletConnector, nonce, walletProvider, environmentId, displaySiweStatement, skipEmptyAccountCheck, siweStatement, publicWalletAddress, signedMessageOverride, messageToSignOverride, }) {
|
|
6
6
|
// WARNING - PLEASE READ!
|
|
7
7
|
// DO NOT ADD ANY NEW ASYNC WORK WITH AWAIT!
|
|
8
8
|
// Deep linking could break with too many blocking awaits
|
|
@@ -32,7 +32,7 @@ var updateJWTAndCreateUserProfile = require('../updateJWTAndCreateUserProfile/up
|
|
|
32
32
|
*
|
|
33
33
|
* @throws Error if the authentication call returns no or invalid JWT
|
|
34
34
|
*/
|
|
35
|
-
const handleUnlinkHelper = (
|
|
35
|
+
const handleUnlinkHelper = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ environmentId, primaryWalletId, walletId, }) {
|
|
36
36
|
const token = getMinAuthToken.getMinAuthToken();
|
|
37
37
|
if (!token)
|
|
38
38
|
return;
|
|
@@ -28,7 +28,7 @@ import { updateJWTAndCreateUserProfile } from '../updateJWTAndCreateUserProfile/
|
|
|
28
28
|
*
|
|
29
29
|
* @throws Error if the authentication call returns no or invalid JWT
|
|
30
30
|
*/
|
|
31
|
-
const handleUnlinkHelper = (
|
|
31
|
+
const handleUnlinkHelper = (_a) => __awaiter(void 0, [_a], void 0, function* ({ environmentId, primaryWalletId, walletId, }) {
|
|
32
32
|
const token = getMinAuthToken();
|
|
33
33
|
if (!token)
|
|
34
34
|
return;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
6
6
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
7
7
|
|
|
8
|
-
const isWalletConnected = (
|
|
8
|
+
const isWalletConnected = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ address, chain, connector, }) {
|
|
9
9
|
const accounts = yield connector.getConnectedAccounts();
|
|
10
10
|
return accounts.some((account) => walletConnectorCore.isSameAddress(account, address, chain));
|
|
11
11
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
2
|
import { isSameAddress } from '@dynamic-labs/wallet-connector-core';
|
|
3
3
|
|
|
4
|
-
const isWalletConnected = (
|
|
4
|
+
const isWalletConnected = (_a) => __awaiter(void 0, [_a], void 0, function* ({ address, chain, connector, }) {
|
|
5
5
|
const accounts = yield connector.getConnectedAccounts();
|
|
6
6
|
return accounts.some((account) => isSameAddress(account, address, chain));
|
|
7
7
|
});
|
|
@@ -115,8 +115,8 @@ const useConnectAndSign = ({ shouldUpdateWallets = true, shouldCallCallback = tr
|
|
|
115
115
|
setErrorMessage((_a = err === null || err === void 0 ? void 0 : err.code) === null || _a === void 0 ? void 0 : _a.toString());
|
|
116
116
|
goToInitialView();
|
|
117
117
|
};
|
|
118
|
-
return (
|
|
119
|
-
var
|
|
118
|
+
return (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ walletConnector, getAddressOpts = undefined }) {
|
|
119
|
+
var _b;
|
|
120
120
|
try {
|
|
121
121
|
yield showPendingConnectView.showPendingConnectView(walletConnector, setView);
|
|
122
122
|
if (walletConnectorCore.isEmailWalletConnector(walletConnector)) {
|
|
@@ -154,7 +154,7 @@ const useConnectAndSign = ({ shouldUpdateWallets = true, shouldCallCallback = tr
|
|
|
154
154
|
}
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
if ((
|
|
157
|
+
if ((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.security.hCaptcha) === null || _b === void 0 ? void 0 : _b.enabled) {
|
|
158
158
|
engageCaptcha({
|
|
159
159
|
authMethod: 'wallet',
|
|
160
160
|
onCaptchaSuccess: (captchaToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -111,8 +111,8 @@ const useConnectAndSign = ({ shouldUpdateWallets = true, shouldCallCallback = tr
|
|
|
111
111
|
setErrorMessage((_a = err === null || err === void 0 ? void 0 : err.code) === null || _a === void 0 ? void 0 : _a.toString());
|
|
112
112
|
goToInitialView();
|
|
113
113
|
};
|
|
114
|
-
return (
|
|
115
|
-
var
|
|
114
|
+
return (_a) => __awaiter(void 0, [_a], void 0, function* ({ walletConnector, getAddressOpts = undefined }) {
|
|
115
|
+
var _b;
|
|
116
116
|
try {
|
|
117
117
|
yield showPendingConnectView(walletConnector, setView);
|
|
118
118
|
if (isEmailWalletConnector(walletConnector)) {
|
|
@@ -150,7 +150,7 @@ const useConnectAndSign = ({ shouldUpdateWallets = true, shouldCallCallback = tr
|
|
|
150
150
|
}
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
153
|
-
if ((
|
|
153
|
+
if ((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.security.hCaptcha) === null || _b === void 0 ? void 0 : _b.enabled) {
|
|
154
154
|
engageCaptcha({
|
|
155
155
|
authMethod: 'wallet',
|
|
156
156
|
onCaptchaSuccess: (captchaToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -110,8 +110,8 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
110
110
|
// It's used when we want to connect and sign in two separate steps
|
|
111
111
|
// For example on mobile when we want to sign on button click
|
|
112
112
|
// or in Dapper
|
|
113
|
-
const onlyConnectUser = (
|
|
114
|
-
var
|
|
113
|
+
const onlyConnectUser = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ walletConnector, getAddressOpts = undefined, }) {
|
|
114
|
+
var _b;
|
|
115
115
|
yield showPendingConnectView.showPendingConnectView(walletConnector, setView);
|
|
116
116
|
try {
|
|
117
117
|
yield connectWallet(walletConnector, getAddressOpts);
|
|
@@ -120,7 +120,7 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
120
120
|
handleWalletsToConnect({ walletConnector });
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
|
-
if ((
|
|
123
|
+
if ((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.security.hCaptcha) === null || _b === void 0 ? void 0 : _b.enabled) {
|
|
124
124
|
engageCaptcha({
|
|
125
125
|
authMethod: 'wallet',
|
|
126
126
|
onCaptchaSuccess: (_captchaToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -140,7 +140,7 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
140
140
|
});
|
|
141
141
|
// This method is similar to useConnectAndSign, but it does not call showPendingConnectView
|
|
142
142
|
// This is because we already called it in onlyConnectUser and now we just want to sign
|
|
143
|
-
const signAlreadyConnectedUser = (
|
|
143
|
+
const signAlreadyConnectedUser = (_c) => _tslib.__awaiter(void 0, [_c], void 0, function* ({ walletConnector, getAddressOpts = undefined, }) {
|
|
144
144
|
try {
|
|
145
145
|
const connectionResult = yield connectWallet(walletConnector, getAddressOpts);
|
|
146
146
|
if (!(connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.address)) {
|
|
@@ -106,8 +106,8 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
106
106
|
// It's used when we want to connect and sign in two separate steps
|
|
107
107
|
// For example on mobile when we want to sign on button click
|
|
108
108
|
// or in Dapper
|
|
109
|
-
const onlyConnectUser = (
|
|
110
|
-
var
|
|
109
|
+
const onlyConnectUser = (_a) => __awaiter(void 0, [_a], void 0, function* ({ walletConnector, getAddressOpts = undefined, }) {
|
|
110
|
+
var _b;
|
|
111
111
|
yield showPendingConnectView(walletConnector, setView);
|
|
112
112
|
try {
|
|
113
113
|
yield connectWallet(walletConnector, getAddressOpts);
|
|
@@ -116,7 +116,7 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
116
116
|
handleWalletsToConnect({ walletConnector });
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
|
-
if ((
|
|
119
|
+
if ((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.security.hCaptcha) === null || _b === void 0 ? void 0 : _b.enabled) {
|
|
120
120
|
engageCaptcha({
|
|
121
121
|
authMethod: 'wallet',
|
|
122
122
|
onCaptchaSuccess: (_captchaToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -136,7 +136,7 @@ const useConnectAndSignSplitSteps = () => {
|
|
|
136
136
|
});
|
|
137
137
|
// This method is similar to useConnectAndSign, but it does not call showPendingConnectView
|
|
138
138
|
// This is because we already called it in onlyConnectUser and now we just want to sign
|
|
139
|
-
const signAlreadyConnectedUser = (
|
|
139
|
+
const signAlreadyConnectedUser = (_c) => __awaiter(void 0, [_c], void 0, function* ({ walletConnector, getAddressOpts = undefined, }) {
|
|
140
140
|
try {
|
|
141
141
|
const connectionResult = yield connectWallet(walletConnector, getAddressOpts);
|
|
142
142
|
if (!(connectionResult === null || connectionResult === void 0 ? void 0 : connectionResult.address)) {
|
package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs
CHANGED
|
@@ -86,7 +86,7 @@ const useSignConnectOnlyUser = () => {
|
|
|
86
86
|
projectSettings,
|
|
87
87
|
setIsSingleWalletAccount,
|
|
88
88
|
});
|
|
89
|
-
return (
|
|
89
|
+
return (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ walletConnector, getAddressOpts = undefined }) {
|
|
90
90
|
try {
|
|
91
91
|
if (walletConnectorCore.isEmbeddedConnector(walletConnector) &&
|
|
92
92
|
!walletConnectorCore.isBloctoConnector(walletConnector)) {
|
package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js
CHANGED
|
@@ -82,7 +82,7 @@ const useSignConnectOnlyUser = () => {
|
|
|
82
82
|
projectSettings,
|
|
83
83
|
setIsSingleWalletAccount,
|
|
84
84
|
});
|
|
85
|
-
return (
|
|
85
|
+
return (_a) => __awaiter(void 0, [_a], void 0, function* ({ walletConnector, getAddressOpts = undefined }) {
|
|
86
86
|
try {
|
|
87
87
|
if (isEmbeddedConnector(walletConnector) &&
|
|
88
88
|
!isBloctoConnector(walletConnector)) {
|
|
@@ -32,4 +32,4 @@ import { EventArgs } from '../types';
|
|
|
32
32
|
* },
|
|
33
33
|
* );
|
|
34
34
|
*/
|
|
35
|
-
export declare const useWalletConnectorEvent: <
|
|
35
|
+
export declare const useWalletConnectorEvent: <Event extends keyof WalletConnectorEventTypes = keyof WalletConnectorEventTypes>(eventEmitters: WalletConnector | WalletConnector[] | undefined, eventName: Event, handler: (...args: [...EventArgs<WalletConnectorEventTypes, Event>, WalletConnector]) => void) => void;
|
|
@@ -76,8 +76,9 @@ require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCa
|
|
|
76
76
|
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
77
77
|
|
|
78
78
|
const useAuthLayoutChecks = () => {
|
|
79
|
+
var _a;
|
|
79
80
|
const { view } = ViewContext.useViewContext();
|
|
80
|
-
const { user, customPrivacyPolicy, customTermsOfServices, privacyPolicyUrl, termsOfServiceUrl, isBridgeFlow, authMode, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
81
|
+
const { user, customPrivacyPolicy, customTermsOfServices, privacyPolicyUrl, termsOfServiceUrl, isBridgeFlow, authMode, projectSettings, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
81
82
|
const { isFooterExpanded } = index.useFooterAnimationContext();
|
|
82
83
|
const { mockedSDK } = MockContext.useMockContext();
|
|
83
84
|
const { helpHeaderData } = useDynamicLayoutData.useDynamicLayoutData({
|
|
@@ -147,22 +148,23 @@ const useAuthLayoutChecks = () => {
|
|
|
147
148
|
privacyPolicyUrl ||
|
|
148
149
|
customPrivacyPolicy ||
|
|
149
150
|
customTermsOfServices))));
|
|
150
|
-
const showDynamicFooter =
|
|
151
|
-
view.type === 'login-with-email-or-wallet
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
151
|
+
const showDynamicFooter = Boolean((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.displayDynamicMessaging) &&
|
|
152
|
+
(view.type === 'login-with-email-or-wallet' ||
|
|
153
|
+
view.type === 'login-with-email-or-wallet-full-wallet-list' ||
|
|
154
|
+
view.type === 'login-with-wallet-only' ||
|
|
155
|
+
view.type === 'login-with-email-verification' ||
|
|
156
|
+
view.type === 'login-with-sms-verification' ||
|
|
157
|
+
view.type === 'verify-email' ||
|
|
158
|
+
view.type === 'verify-sms' ||
|
|
159
|
+
view.type === 'pending-connect' ||
|
|
160
|
+
view.type === 'wallet-group' ||
|
|
161
|
+
view.type === 'select-wallet-in-wallet-group' ||
|
|
162
|
+
view.type === 'select-hardware-wallet' ||
|
|
163
|
+
view.type === 'pending-signature' ||
|
|
164
|
+
view.type === 'qr-code' ||
|
|
165
|
+
view.type === 'wallet-used' ||
|
|
166
|
+
view.type === 'email-wallet-otp-verification-view' ||
|
|
167
|
+
view.type === 'farcaster-connect-view');
|
|
166
168
|
const showCloseButton = view.type !== 'login-with-email-or-wallet-full-wallet-list' &&
|
|
167
169
|
view.type !== 'login-with-email-verification' &&
|
|
168
170
|
view.type !== 'login-with-sms-verification' &&
|
|
@@ -72,8 +72,9 @@ import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCar
|
|
|
72
72
|
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
73
73
|
|
|
74
74
|
const useAuthLayoutChecks = () => {
|
|
75
|
+
var _a;
|
|
75
76
|
const { view } = useViewContext();
|
|
76
|
-
const { user, customPrivacyPolicy, customTermsOfServices, privacyPolicyUrl, termsOfServiceUrl, isBridgeFlow, authMode, } = useInternalDynamicContext();
|
|
77
|
+
const { user, customPrivacyPolicy, customTermsOfServices, privacyPolicyUrl, termsOfServiceUrl, isBridgeFlow, authMode, projectSettings, } = useInternalDynamicContext();
|
|
77
78
|
const { isFooterExpanded } = useFooterAnimationContext();
|
|
78
79
|
const { mockedSDK } = useMockContext();
|
|
79
80
|
const { helpHeaderData } = useDynamicLayoutData({
|
|
@@ -143,22 +144,23 @@ const useAuthLayoutChecks = () => {
|
|
|
143
144
|
privacyPolicyUrl ||
|
|
144
145
|
customPrivacyPolicy ||
|
|
145
146
|
customTermsOfServices))));
|
|
146
|
-
const showDynamicFooter =
|
|
147
|
-
view.type === 'login-with-email-or-wallet
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
147
|
+
const showDynamicFooter = Boolean((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.displayDynamicMessaging) &&
|
|
148
|
+
(view.type === 'login-with-email-or-wallet' ||
|
|
149
|
+
view.type === 'login-with-email-or-wallet-full-wallet-list' ||
|
|
150
|
+
view.type === 'login-with-wallet-only' ||
|
|
151
|
+
view.type === 'login-with-email-verification' ||
|
|
152
|
+
view.type === 'login-with-sms-verification' ||
|
|
153
|
+
view.type === 'verify-email' ||
|
|
154
|
+
view.type === 'verify-sms' ||
|
|
155
|
+
view.type === 'pending-connect' ||
|
|
156
|
+
view.type === 'wallet-group' ||
|
|
157
|
+
view.type === 'select-wallet-in-wallet-group' ||
|
|
158
|
+
view.type === 'select-hardware-wallet' ||
|
|
159
|
+
view.type === 'pending-signature' ||
|
|
160
|
+
view.type === 'qr-code' ||
|
|
161
|
+
view.type === 'wallet-used' ||
|
|
162
|
+
view.type === 'email-wallet-otp-verification-view' ||
|
|
163
|
+
view.type === 'farcaster-connect-view');
|
|
162
164
|
const showCloseButton = view.type !== 'login-with-email-or-wallet-full-wallet-list' &&
|
|
163
165
|
view.type !== 'login-with-email-verification' &&
|
|
164
166
|
view.type !== 'login-with-sms-verification' &&
|
|
@@ -92,8 +92,8 @@ const useCreateDynamicEmbeddedWalletMutation = () => {
|
|
|
92
92
|
const embeddedChains = embeddedChainConfig
|
|
93
93
|
.filter((chain) => chain.enabled)
|
|
94
94
|
.map((c) => (c.name === 'SOL' ? sdkApiCore.ChainEnum.Sol : sdkApiCore.ChainEnum.Evm));
|
|
95
|
-
const createDynamicEmbeddedWalletMutation = React.useCallback((
|
|
96
|
-
var
|
|
95
|
+
const createDynamicEmbeddedWalletMutation = React.useCallback((_d) => _tslib.__awaiter(void 0, [_d], void 0, function* ({ authToken, decodedJwt, environmentId, walletConnectorOptions, withAuthenticator, }) {
|
|
96
|
+
var _e, _f;
|
|
97
97
|
setIsLoading(true);
|
|
98
98
|
const createEmbeddedWalletMethodToUse = withAuthenticator
|
|
99
99
|
? createEmbeddedWalletWithPasskey.createEmbeddedWalletWithPasskey
|
|
@@ -106,9 +106,9 @@ const useCreateDynamicEmbeddedWalletMutation = () => {
|
|
|
106
106
|
user: user !== null && user !== void 0 ? user : createUserProfile.createUserProfile(decodedJwt),
|
|
107
107
|
walletConnector: findPasskeyEmailWalletConnector.findPasskeyEmailWalletConnector(walletConnectorOptions, primaryEmbeddedChain),
|
|
108
108
|
});
|
|
109
|
-
const turnkeyVerifiedCredentials = (
|
|
109
|
+
const turnkeyVerifiedCredentials = (_e = updatedDecodedJwt === null || updatedDecodedJwt === void 0 ? void 0 : updatedDecodedJwt.verifiedCredentials) === null || _e === void 0 ? void 0 : _e.find(({ walletName }) => walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey'));
|
|
110
110
|
/** It's not authenticated if it's a turnkey wallet that still hasn't created a passkey */
|
|
111
|
-
const authenticated = Boolean((
|
|
111
|
+
const authenticated = Boolean((_f = turnkeyVerifiedCredentials === null || turnkeyVerifiedCredentials === void 0 ? void 0 : turnkeyVerifiedCredentials.walletProperties) === null || _f === void 0 ? void 0 : _f.isAuthenticatorAttached);
|
|
112
112
|
const passkeyWallet = {
|
|
113
113
|
address: (yield walletConnector.getAddress()) || '',
|
|
114
114
|
authenticated,
|
|
@@ -88,8 +88,8 @@ const useCreateDynamicEmbeddedWalletMutation = () => {
|
|
|
88
88
|
const embeddedChains = embeddedChainConfig
|
|
89
89
|
.filter((chain) => chain.enabled)
|
|
90
90
|
.map((c) => (c.name === 'SOL' ? ChainEnum.Sol : ChainEnum.Evm));
|
|
91
|
-
const createDynamicEmbeddedWalletMutation = useCallback((
|
|
92
|
-
var
|
|
91
|
+
const createDynamicEmbeddedWalletMutation = useCallback((_d) => __awaiter(void 0, [_d], void 0, function* ({ authToken, decodedJwt, environmentId, walletConnectorOptions, withAuthenticator, }) {
|
|
92
|
+
var _e, _f;
|
|
93
93
|
setIsLoading(true);
|
|
94
94
|
const createEmbeddedWalletMethodToUse = withAuthenticator
|
|
95
95
|
? createEmbeddedWalletWithPasskey
|
|
@@ -102,9 +102,9 @@ const useCreateDynamicEmbeddedWalletMutation = () => {
|
|
|
102
102
|
user: user !== null && user !== void 0 ? user : createUserProfile(decodedJwt),
|
|
103
103
|
walletConnector: findPasskeyEmailWalletConnector(walletConnectorOptions, primaryEmbeddedChain),
|
|
104
104
|
});
|
|
105
|
-
const turnkeyVerifiedCredentials = (
|
|
105
|
+
const turnkeyVerifiedCredentials = (_e = updatedDecodedJwt === null || updatedDecodedJwt === void 0 ? void 0 : updatedDecodedJwt.verifiedCredentials) === null || _e === void 0 ? void 0 : _e.find(({ walletName }) => walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey'));
|
|
106
106
|
/** It's not authenticated if it's a turnkey wallet that still hasn't created a passkey */
|
|
107
|
-
const authenticated = Boolean((
|
|
107
|
+
const authenticated = Boolean((_f = turnkeyVerifiedCredentials === null || turnkeyVerifiedCredentials === void 0 ? void 0 : turnkeyVerifiedCredentials.walletProperties) === null || _f === void 0 ? void 0 : _f.isAuthenticatorAttached);
|
|
108
108
|
const passkeyWallet = {
|
|
109
109
|
address: (yield walletConnector.getAddress()) || '',
|
|
110
110
|
authenticated,
|
|
@@ -108,7 +108,7 @@ const useEmbeddedReveal = () => {
|
|
|
108
108
|
throw new Error('Coinbase MPC wallet not found');
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
|
-
const initExportProcess = React.useCallback((
|
|
111
|
+
const initExportProcess = React.useCallback((...args_1) => _tslib.__awaiter(void 0, [...args_1], void 0, function* (recoveryPhrase = false) {
|
|
112
112
|
if (!primaryWallet) {
|
|
113
113
|
throw new Error('No primary wallet');
|
|
114
114
|
}
|
|
@@ -104,7 +104,7 @@ const useEmbeddedReveal = () => {
|
|
|
104
104
|
throw new Error('Coinbase MPC wallet not found');
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
|
-
const initExportProcess = useCallback((
|
|
107
|
+
const initExportProcess = useCallback((...args_1) => __awaiter(void 0, [...args_1], void 0, function* (recoveryPhrase = false) {
|
|
108
108
|
if (!primaryWallet) {
|
|
109
109
|
throw new Error('No primary wallet');
|
|
110
110
|
}
|
|
@@ -98,7 +98,7 @@ const useCoinbaseMPC = () => {
|
|
|
98
98
|
};
|
|
99
99
|
return coinbaseMPCWallet;
|
|
100
100
|
}), [setPrimaryWalletId]);
|
|
101
|
-
const linkCoinbaseMPCWallet = React.useCallback((
|
|
101
|
+
const linkCoinbaseMPCWallet = React.useCallback((_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ connector, backupCode, password, source, jwt, }) {
|
|
102
102
|
const nonce = consumeNonce();
|
|
103
103
|
if (nonce === undefined)
|
|
104
104
|
throw new utils.DynamicError('Missing nonce');
|
|
@@ -174,9 +174,9 @@ const useCoinbaseMPC = () => {
|
|
|
174
174
|
}
|
|
175
175
|
return undefined;
|
|
176
176
|
}), [linkCoinbaseMPCWallet, handleLogOut, setError]);
|
|
177
|
-
const createCoinbaseMPCWallet = React.useCallback((
|
|
178
|
-
var
|
|
179
|
-
const connector = (
|
|
177
|
+
const createCoinbaseMPCWallet = React.useCallback((jwt_1, decodedJwt_1, ...args_1) => _tslib.__awaiter(void 0, [jwt_1, decodedJwt_1, ...args_1], void 0, function* (jwt, decodedJwt, chain = sdkApiCore.ChainEnum.Evm, password) {
|
|
178
|
+
var _b;
|
|
179
|
+
const connector = (_b = findCoinbaseMPCWallet.findCoinbaseMPCWallet(walletConnectorOptions)) === null || _b === void 0 ? void 0 : _b.walletConnector;
|
|
180
180
|
if (!connector || !walletConnectorCore.isCoinbaseMpcWalletConnector(connector)) {
|
|
181
181
|
const error = new utils.DynamicError('CoinbaseWaaSWalletConnectors not found');
|
|
182
182
|
logger.logger.error('Failed to create embedded wallet', error);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ChainEnum, DynamicJwt } from '@dynamic-labs/sdk-api-core';
|
|
2
|
+
import { Wallet } from '../../../../shared';
|
|
3
|
+
export declare const useCoinbaseMPC: () => {
|
|
4
|
+
createCoinbaseMPCWallet: (jwt: string, decodedJwt: DynamicJwt, chain?: ChainEnum, password?: string) => Promise<Wallet | undefined>;
|
|
5
|
+
};
|
|
@@ -94,7 +94,7 @@ const useCoinbaseMPC = () => {
|
|
|
94
94
|
};
|
|
95
95
|
return coinbaseMPCWallet;
|
|
96
96
|
}), [setPrimaryWalletId]);
|
|
97
|
-
const linkCoinbaseMPCWallet = useCallback((
|
|
97
|
+
const linkCoinbaseMPCWallet = useCallback((_a) => __awaiter(void 0, [_a], void 0, function* ({ connector, backupCode, password, source, jwt, }) {
|
|
98
98
|
const nonce = consumeNonce();
|
|
99
99
|
if (nonce === undefined)
|
|
100
100
|
throw new DynamicError('Missing nonce');
|
|
@@ -170,9 +170,9 @@ const useCoinbaseMPC = () => {
|
|
|
170
170
|
}
|
|
171
171
|
return undefined;
|
|
172
172
|
}), [linkCoinbaseMPCWallet, handleLogOut, setError]);
|
|
173
|
-
const createCoinbaseMPCWallet = useCallback((
|
|
174
|
-
var
|
|
175
|
-
const connector = (
|
|
173
|
+
const createCoinbaseMPCWallet = useCallback((jwt_1, decodedJwt_1, ...args_1) => __awaiter(void 0, [jwt_1, decodedJwt_1, ...args_1], void 0, function* (jwt, decodedJwt, chain = ChainEnum.Evm, password) {
|
|
174
|
+
var _b;
|
|
175
|
+
const connector = (_b = findCoinbaseMPCWallet(walletConnectorOptions)) === null || _b === void 0 ? void 0 : _b.walletConnector;
|
|
176
176
|
if (!connector || !isCoinbaseMpcWalletConnector(connector)) {
|
|
177
177
|
const error = new DynamicError('CoinbaseWaaSWalletConnectors not found');
|
|
178
178
|
logger.error('Failed to create embedded wallet', error);
|
|
@@ -55,7 +55,7 @@ const useHandleVerificationRequired = (updateUser) => {
|
|
|
55
55
|
return Object.assign(Object.assign({}, updateUserProfileResponse), { emailVerification,
|
|
56
56
|
smsVerification });
|
|
57
57
|
}), [updateUser]);
|
|
58
|
-
const handleVerificationRequired = React.useCallback((
|
|
58
|
+
const handleVerificationRequired = React.useCallback((_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ updateUserProfileResponse: updateUserProfileResponseRaw, missingFields, destination, jwtOverride, }) {
|
|
59
59
|
const updateUserProfileResponse = yield collectNecessaryVerificationData(destination, updateUserProfileResponseRaw, jwtOverride);
|
|
60
60
|
// Use this information in the Verification view
|
|
61
61
|
const { displayDestination, verificationUUID } = getResponseInfo(updateUserProfileResponse, destination);
|
|
@@ -51,7 +51,7 @@ const useHandleVerificationRequired = (updateUser) => {
|
|
|
51
51
|
return Object.assign(Object.assign({}, updateUserProfileResponse), { emailVerification,
|
|
52
52
|
smsVerification });
|
|
53
53
|
}), [updateUser]);
|
|
54
|
-
const handleVerificationRequired = useCallback((
|
|
54
|
+
const handleVerificationRequired = useCallback((_a) => __awaiter(void 0, [_a], void 0, function* ({ updateUserProfileResponse: updateUserProfileResponseRaw, missingFields, destination, jwtOverride, }) {
|
|
55
55
|
const updateUserProfileResponse = yield collectNecessaryVerificationData(destination, updateUserProfileResponseRaw, jwtOverride);
|
|
56
56
|
// Use this information in the Verification view
|
|
57
57
|
const { displayDestination, verificationUUID } = getResponseInfo(updateUserProfileResponse, destination);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
2
2
|
export declare const useHandleWalletsToConnect: () => {
|
|
3
3
|
handleWalletsToConnect: ({ walletConnector, }: {
|
|
4
|
-
walletConnector?:
|
|
4
|
+
walletConnector?: WalletConnector;
|
|
5
5
|
}) => void;
|
|
6
6
|
};
|
package/src/lib/utils/hooks/useInitEmbeddedWalletAuthMethod/useInitEmbeddedWalletAuthMethod.cjs
CHANGED
|
@@ -83,12 +83,12 @@ const useInitEmbeddedWalletAuthMethod = () => {
|
|
|
83
83
|
const { setView } = ViewContext.useViewContext();
|
|
84
84
|
const [isLoading, setIsLoading] = React.useState(false);
|
|
85
85
|
const [error, setError] = React.useState();
|
|
86
|
-
const initAuthMethod = (
|
|
87
|
-
var
|
|
86
|
+
const initAuthMethod = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ authenticatorType, iframeContainer, currentAction, }) {
|
|
87
|
+
var _b, _c, _d, _e;
|
|
88
88
|
setIsLoading(true);
|
|
89
89
|
const wallet = getEOAWallet.getEOAWallet(primaryWallet, (user === null || user === void 0 ? void 0 : user.verifiedCredentials) || []);
|
|
90
|
-
const sessionExpiration = ((
|
|
91
|
-
const sessionExpirationUnit = ((
|
|
90
|
+
const sessionExpiration = ((_c = (_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _b === void 0 ? void 0 : _b.sessionKeyDuration) === null || _c === void 0 ? void 0 : _c.amount) || 0;
|
|
91
|
+
const sessionExpirationUnit = ((_e = (_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.embeddedWallets) === null || _d === void 0 ? void 0 : _d.sessionKeyDuration) === null || _e === void 0 ? void 0 : _e.unit) ===
|
|
92
92
|
'minutes'
|
|
93
93
|
? 60
|
|
94
94
|
: 3600;
|