@dynamic-labs/sdk-react-core 2.0.0-alpha.31 → 2.0.0-alpha.32
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 +2 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +14 -14
- package/src/index.d.ts +1 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.cjs +21 -6
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.js +16 -1
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.cjs +17 -3
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.js +15 -1
- package/src/lib/context/ConnectWithOtpContext/utils/findEmailProvider.cjs +19 -4
- package/src/lib/context/ConnectWithOtpContext/utils/findEmailProvider.js +16 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +17 -17
- package/src/lib/context/DynamicContext/DynamicContext.js +3 -3
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +6 -6
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +5 -5
- package/src/lib/context/FundingContext/FundingContext.cjs +6 -6
- package/src/lib/context/FundingContext/FundingContext.js +5 -5
- package/src/lib/context/PasskeyContext/PasskeyContext.cjs +4 -4
- package/src/lib/context/PasskeyContext/PasskeyContext.js +3 -3
- package/src/lib/data/api/api.cjs +24 -0
- package/src/lib/data/api/api.d.ts +2 -0
- package/src/lib/data/api/api.js +20 -0
- package/src/lib/data/api/email/email.cjs +118 -0
- package/src/lib/data/api/email/email.d.ts +26 -0
- package/src/lib/data/api/email/email.js +110 -0
- package/src/lib/data/api/email/index.d.ts +1 -0
- package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +191 -0
- package/src/lib/data/api/embeddedWallets/embeddedWallets.d.ts +30 -0
- package/src/lib/data/api/embeddedWallets/embeddedWallets.js +177 -0
- package/src/lib/data/api/embeddedWallets/index.d.ts +2 -0
- package/src/lib/data/api/embeddedWallets/types.d.ts +39 -0
- package/src/lib/data/api/index.d.ts +10 -0
- package/src/lib/data/api/oauth/index.d.ts +1 -0
- package/src/lib/data/api/oauth/oauth.cjs +136 -0
- package/src/lib/data/api/oauth/oauth.d.ts +11 -0
- package/src/lib/data/api/oauth/oauth.js +128 -0
- package/src/lib/data/api/onramp/index.d.ts +1 -0
- package/src/lib/data/api/onramp/onramp.cjs +22 -0
- package/src/lib/data/api/onramp/onramp.d.ts +8 -0
- package/src/lib/data/api/onramp/onramp.js +18 -0
- package/src/lib/data/api/session/index.d.ts +1 -0
- package/src/lib/data/api/session/session.cjs +77 -0
- package/src/lib/data/api/session/session.d.ts +17 -0
- package/src/lib/data/api/session/session.js +69 -0
- package/src/lib/data/api/settings/index.d.ts +1 -0
- package/src/lib/data/api/settings/settings.cjs +58 -0
- package/src/lib/data/api/settings/settings.d.ts +7 -0
- package/src/lib/data/api/settings/settings.js +53 -0
- package/src/lib/data/api/sms/index.d.ts +1 -0
- package/src/lib/data/api/sms/sms.cjs +102 -0
- package/src/lib/data/api/sms/sms.d.ts +32 -0
- package/src/lib/data/api/sms/sms.js +95 -0
- package/src/lib/data/api/user/index.d.ts +1 -0
- package/src/lib/data/api/user/user.cjs +77 -0
- package/src/lib/data/api/user/user.d.ts +9 -0
- package/src/lib/data/api/user/user.js +71 -0
- package/src/lib/data/api/utils.cjs +20 -0
- package/src/lib/data/api/utils.d.ts +1 -0
- package/src/lib/data/api/utils.js +16 -0
- package/src/lib/data/api/wallets/index.d.ts +1 -0
- package/src/lib/data/api/wallets/wallets.cjs +137 -0
- package/src/lib/data/api/wallets/wallets.d.ts +10 -0
- package/src/lib/data/api/wallets/wallets.js +130 -0
- package/src/lib/data/index.d.ts +1 -0
- package/src/lib/shared/types/dynamicEventsCallbacks.d.ts +3 -4
- package/src/lib/shared/types/general.d.ts +1 -0
- package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.cjs +18 -4
- package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.js +15 -1
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.cjs +6 -4
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.js +5 -3
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.cjs +4 -3
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.d.ts +3 -3
- package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.js +3 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +4 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +3 -1
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.cjs +6 -6
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.js +3 -3
- package/src/lib/utils/hooks/useEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +4 -4
- package/src/lib/utils/hooks/useEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +3 -3
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.cjs +4 -4
- package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.js +3 -3
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.cjs +6 -4
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.js +3 -1
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +6 -6
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +3 -3
- package/src/lib/utils/hooks/useHandleVerificationRequired/useHandleVerificationRequired.d.ts +4 -4
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +8 -8
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +3 -3
- package/src/lib/utils/hooks/useSendDynamicProps/useSendDynamicProps.cjs +9 -6
- package/src/lib/utils/hooks/useSendDynamicProps/useSendDynamicProps.js +4 -1
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +4 -4
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +3 -3
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +7 -7
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +3 -3
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +4 -4
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +3 -3
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +5 -5
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +3 -3
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +4 -4
- package/src/lib/views/EmailUpdate/EmailUpdate.js +3 -3
- package/src/lib/views/EmailVerification/EmailVerification.cjs +11 -11
- package/src/lib/views/EmailVerification/EmailVerification.js +3 -3
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +4 -2
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +3 -1
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.cjs +3 -3
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.js +2 -2
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +7 -7
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +3 -3
- package/src/lib/views/Passkey/RenamePasskeyView/RenamePasskeyView.cjs +4 -4
- package/src/lib/views/Passkey/RenamePasskeyView/RenamePasskeyView.js +3 -3
- package/src/lib/views/Passkey/utils/createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.cjs +4 -2
- package/src/lib/views/Passkey/utils/createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.js +3 -1
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.cjs +4 -2
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.js +3 -1
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +11 -8
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +5 -2
- package/src/lib/views/SelectWalletInWalletGroupView/components/WalletGroupItem/index.d.ts +1 -0
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.cjs +4 -4
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.js +2 -2
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +4 -4
- package/src/lib/views/WalletUsedView/WalletUsedView.js +3 -3
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.js +6 -2
- package/src/lib/data/api.cjs +0 -797
- package/src/lib/data/api.d.ts +0 -179
- package/src/lib/data/api.js +0 -753
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
6
|
+
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
7
|
+
var utils = require('@dynamic-labs/utils');
|
|
8
|
+
var logger = require('../../../shared/logger.cjs');
|
|
9
|
+
require('@dynamic-labs/iconic');
|
|
10
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
11
|
+
require('react/jsx-runtime');
|
|
12
|
+
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
require('react');
|
|
14
|
+
require('@dynamic-labs/wallet-book');
|
|
15
|
+
require('../../../utils/constants/colors.cjs');
|
|
16
|
+
require('../../../utils/constants/values.cjs');
|
|
17
|
+
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
18
|
+
require('../../../shared/consts/index.cjs');
|
|
19
|
+
var api = require('../api.cjs');
|
|
20
|
+
|
|
21
|
+
const linkWallet = (environmentId, { messageToSign, network, signedMessage, publicWalletAddress, chain, walletName, walletProvider, additionalWalletAddresses, backup, password, passwordSource, }, userJwt) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
const verifyRequest = sdkApiCore.VerifyRequestFromJSON({
|
|
23
|
+
additionalWalletAddresses,
|
|
24
|
+
backup,
|
|
25
|
+
chain,
|
|
26
|
+
messageToSign,
|
|
27
|
+
network,
|
|
28
|
+
password,
|
|
29
|
+
passwordSource,
|
|
30
|
+
publicWalletAddress,
|
|
31
|
+
signedMessage,
|
|
32
|
+
walletName,
|
|
33
|
+
walletProvider,
|
|
34
|
+
});
|
|
35
|
+
try {
|
|
36
|
+
const response = yield api.sdkApi(userJwt).verifyLink({
|
|
37
|
+
environmentId,
|
|
38
|
+
verifyRequest,
|
|
39
|
+
});
|
|
40
|
+
return response;
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
logger.logger.error(e);
|
|
44
|
+
const data = yield e.json();
|
|
45
|
+
if (data.code === 'reassign_wallet_confirm' ||
|
|
46
|
+
data.code === 'reassign_wallet_error') {
|
|
47
|
+
throw new utils.WalletUsedError(data.code);
|
|
48
|
+
}
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const unlinkWallet = ({ environmentId, primaryWalletId, walletId, }, userJwt) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
+
try {
|
|
54
|
+
const response = yield api.sdkApi(userJwt).verifyUnlink({
|
|
55
|
+
environmentId,
|
|
56
|
+
verifyUnlinkRequest: {
|
|
57
|
+
primaryWalletId,
|
|
58
|
+
walletId,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
return response;
|
|
62
|
+
}
|
|
63
|
+
catch (e) {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const transferWallet = (environmentId, { network, messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, skipEmptyAccountCheck = false, }, userJwt) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
68
|
+
// We should find a better way to do this than force type casting
|
|
69
|
+
const verifyRequest = {
|
|
70
|
+
chain,
|
|
71
|
+
messageToSign,
|
|
72
|
+
network,
|
|
73
|
+
publicWalletAddress,
|
|
74
|
+
signedMessage,
|
|
75
|
+
skipEmptyAccountCheck,
|
|
76
|
+
walletName,
|
|
77
|
+
walletProvider,
|
|
78
|
+
};
|
|
79
|
+
try {
|
|
80
|
+
const response = yield api.sdkApi(userJwt).verifyTransfer({
|
|
81
|
+
environmentId,
|
|
82
|
+
verifyRequest,
|
|
83
|
+
});
|
|
84
|
+
return response;
|
|
85
|
+
}
|
|
86
|
+
catch (_a) {
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
const verifyWallet = (environmentId, { messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, captchaToken, network, oauth, additionalWalletAddresses, }) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
91
|
+
const verifyRequest = sdkApiCore.VerifyRequestFromJSON({
|
|
92
|
+
additionalWalletAddresses,
|
|
93
|
+
captchaToken,
|
|
94
|
+
chain,
|
|
95
|
+
messageToSign,
|
|
96
|
+
network,
|
|
97
|
+
oauth,
|
|
98
|
+
publicWalletAddress,
|
|
99
|
+
signedMessage,
|
|
100
|
+
walletName,
|
|
101
|
+
walletProvider,
|
|
102
|
+
});
|
|
103
|
+
try {
|
|
104
|
+
const response = yield api.sdkApi().verify({
|
|
105
|
+
environmentId,
|
|
106
|
+
verifyRequest,
|
|
107
|
+
});
|
|
108
|
+
return response;
|
|
109
|
+
}
|
|
110
|
+
catch (e) {
|
|
111
|
+
logger.logger.error(e);
|
|
112
|
+
const data = yield e.json();
|
|
113
|
+
if (data.code === 'wallet_not_deployed') {
|
|
114
|
+
throw new utils.WalletNotDeployedError();
|
|
115
|
+
}
|
|
116
|
+
if (data.error.code === 'chainalysis_blocked_wallet') {
|
|
117
|
+
throw new utils.ChainalysisError(data.payload.walletPublicKey);
|
|
118
|
+
}
|
|
119
|
+
if (data.error.code === 'gate_blocked') {
|
|
120
|
+
throw new utils.GateBlockedError(data.payload.walletPublicKey);
|
|
121
|
+
}
|
|
122
|
+
if (data.error.code === 'missing_from_list') {
|
|
123
|
+
throw new utils.NoAccessError({
|
|
124
|
+
walletPublicKey: data.payload.walletPublicKey,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (data.code === 'email_associated_with_different_provider') {
|
|
128
|
+
throw new utils.AccountExistsError(data.error, data.payload);
|
|
129
|
+
}
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
exports.linkWallet = linkWallet;
|
|
135
|
+
exports.transferWallet = transferWallet;
|
|
136
|
+
exports.unlinkWallet = unlinkWallet;
|
|
137
|
+
exports.verifyWallet = verifyWallet;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VerifyResponse } from '@dynamic-labs/sdk-api-core';
|
|
2
|
+
import { VerifyWallet } from '../../../shared/types';
|
|
3
|
+
export declare const linkWallet: (environmentId: string, { messageToSign, network, signedMessage, publicWalletAddress, chain, walletName, walletProvider, additionalWalletAddresses, backup, password, passwordSource, }: VerifyWallet, userJwt: string) => Promise<VerifyResponse | undefined>;
|
|
4
|
+
export declare const unlinkWallet: ({ environmentId, primaryWalletId, walletId, }: {
|
|
5
|
+
environmentId: string;
|
|
6
|
+
primaryWalletId: string | undefined;
|
|
7
|
+
walletId: string;
|
|
8
|
+
}, userJwt: string) => Promise<VerifyResponse | undefined>;
|
|
9
|
+
export declare const transferWallet: (environmentId: string, { network, messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, skipEmptyAccountCheck, }: VerifyWallet, userJwt: string) => Promise<VerifyResponse | undefined>;
|
|
10
|
+
export declare const verifyWallet: (environmentId: string, { messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, captchaToken, network, oauth, additionalWalletAddresses, }: VerifyWallet) => Promise<VerifyResponse | undefined>;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
|
+
import { VerifyRequestFromJSON } from '@dynamic-labs/sdk-api-core';
|
|
3
|
+
import { WalletUsedError, WalletNotDeployedError, ChainalysisError, GateBlockedError, NoAccessError, AccountExistsError } from '@dynamic-labs/utils';
|
|
4
|
+
import { logger } from '../../../shared/logger.js';
|
|
5
|
+
import '@dynamic-labs/iconic';
|
|
6
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
7
|
+
import 'react/jsx-runtime';
|
|
8
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import 'react';
|
|
10
|
+
import '@dynamic-labs/wallet-book';
|
|
11
|
+
import '../../../utils/constants/colors.js';
|
|
12
|
+
import '../../../utils/constants/values.js';
|
|
13
|
+
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
14
|
+
import '../../../shared/consts/index.js';
|
|
15
|
+
import { sdkApi } from '../api.js';
|
|
16
|
+
|
|
17
|
+
const linkWallet = (environmentId, { messageToSign, network, signedMessage, publicWalletAddress, chain, walletName, walletProvider, additionalWalletAddresses, backup, password, passwordSource, }, userJwt) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
const verifyRequest = VerifyRequestFromJSON({
|
|
19
|
+
additionalWalletAddresses,
|
|
20
|
+
backup,
|
|
21
|
+
chain,
|
|
22
|
+
messageToSign,
|
|
23
|
+
network,
|
|
24
|
+
password,
|
|
25
|
+
passwordSource,
|
|
26
|
+
publicWalletAddress,
|
|
27
|
+
signedMessage,
|
|
28
|
+
walletName,
|
|
29
|
+
walletProvider,
|
|
30
|
+
});
|
|
31
|
+
try {
|
|
32
|
+
const response = yield sdkApi(userJwt).verifyLink({
|
|
33
|
+
environmentId,
|
|
34
|
+
verifyRequest,
|
|
35
|
+
});
|
|
36
|
+
return response;
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
logger.error(e);
|
|
40
|
+
const data = yield e.json();
|
|
41
|
+
if (data.code === 'reassign_wallet_confirm' ||
|
|
42
|
+
data.code === 'reassign_wallet_error') {
|
|
43
|
+
throw new WalletUsedError(data.code);
|
|
44
|
+
}
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const unlinkWallet = ({ environmentId, primaryWalletId, walletId, }, userJwt) => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
+
try {
|
|
50
|
+
const response = yield sdkApi(userJwt).verifyUnlink({
|
|
51
|
+
environmentId,
|
|
52
|
+
verifyUnlinkRequest: {
|
|
53
|
+
primaryWalletId,
|
|
54
|
+
walletId,
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
return response;
|
|
58
|
+
}
|
|
59
|
+
catch (e) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
const transferWallet = (environmentId, { network, messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, skipEmptyAccountCheck = false, }, userJwt) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
+
// We should find a better way to do this than force type casting
|
|
65
|
+
const verifyRequest = {
|
|
66
|
+
chain,
|
|
67
|
+
messageToSign,
|
|
68
|
+
network,
|
|
69
|
+
publicWalletAddress,
|
|
70
|
+
signedMessage,
|
|
71
|
+
skipEmptyAccountCheck,
|
|
72
|
+
walletName,
|
|
73
|
+
walletProvider,
|
|
74
|
+
};
|
|
75
|
+
try {
|
|
76
|
+
const response = yield sdkApi(userJwt).verifyTransfer({
|
|
77
|
+
environmentId,
|
|
78
|
+
verifyRequest,
|
|
79
|
+
});
|
|
80
|
+
return response;
|
|
81
|
+
}
|
|
82
|
+
catch (_a) {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
const verifyWallet = (environmentId, { messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, captchaToken, network, oauth, additionalWalletAddresses, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
87
|
+
const verifyRequest = VerifyRequestFromJSON({
|
|
88
|
+
additionalWalletAddresses,
|
|
89
|
+
captchaToken,
|
|
90
|
+
chain,
|
|
91
|
+
messageToSign,
|
|
92
|
+
network,
|
|
93
|
+
oauth,
|
|
94
|
+
publicWalletAddress,
|
|
95
|
+
signedMessage,
|
|
96
|
+
walletName,
|
|
97
|
+
walletProvider,
|
|
98
|
+
});
|
|
99
|
+
try {
|
|
100
|
+
const response = yield sdkApi().verify({
|
|
101
|
+
environmentId,
|
|
102
|
+
verifyRequest,
|
|
103
|
+
});
|
|
104
|
+
return response;
|
|
105
|
+
}
|
|
106
|
+
catch (e) {
|
|
107
|
+
logger.error(e);
|
|
108
|
+
const data = yield e.json();
|
|
109
|
+
if (data.code === 'wallet_not_deployed') {
|
|
110
|
+
throw new WalletNotDeployedError();
|
|
111
|
+
}
|
|
112
|
+
if (data.error.code === 'chainalysis_blocked_wallet') {
|
|
113
|
+
throw new ChainalysisError(data.payload.walletPublicKey);
|
|
114
|
+
}
|
|
115
|
+
if (data.error.code === 'gate_blocked') {
|
|
116
|
+
throw new GateBlockedError(data.payload.walletPublicKey);
|
|
117
|
+
}
|
|
118
|
+
if (data.error.code === 'missing_from_list') {
|
|
119
|
+
throw new NoAccessError({
|
|
120
|
+
walletPublicKey: data.payload.walletPublicKey,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
if (data.code === 'email_associated_with_different_provider') {
|
|
124
|
+
throw new AccountExistsError(data.error, data.payload);
|
|
125
|
+
}
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
export { linkWallet, transferWallet, unlinkWallet, verifyWallet };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './api';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';
|
|
2
|
-
import { OtpVerificationDestination } from '../../utils/hooks/authenticationHooks/useOtpVerificationRequest';
|
|
3
2
|
import { UserProfile } from './user';
|
|
4
3
|
import { Wallet } from './wallets';
|
|
5
|
-
import { PhoneData } from '.';
|
|
4
|
+
import { OtpDestination, PhoneData } from '.';
|
|
6
5
|
export type DynamicEventsCallbacks = {
|
|
7
6
|
onSignedMessage?: (params: {
|
|
8
7
|
messageToSign: string;
|
|
@@ -41,10 +40,10 @@ export type OnOtpVerificationResult = (
|
|
|
41
40
|
isSuccess: boolean,
|
|
42
41
|
/** Data on where the OTP was sent to */
|
|
43
42
|
destination: {
|
|
44
|
-
type: Extract<
|
|
43
|
+
type: Extract<OtpDestination, 'email'>;
|
|
45
44
|
value: string;
|
|
46
45
|
} | {
|
|
47
|
-
type: Extract<
|
|
46
|
+
type: Extract<OtpDestination, 'sms'>;
|
|
48
47
|
value: PhoneData;
|
|
49
48
|
}) => void;
|
|
50
49
|
export type OnUserProfileUpdate = (user: UserProfile) => void;
|
package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.cjs
CHANGED
|
@@ -4,24 +4,38 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
6
6
|
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
7
|
-
|
|
7
|
+
require('@dynamic-labs/utils');
|
|
8
|
+
require('../../../shared/logger.cjs');
|
|
9
|
+
require('@dynamic-labs/iconic');
|
|
10
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
11
|
+
require('react/jsx-runtime');
|
|
12
|
+
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
require('react');
|
|
14
|
+
require('@dynamic-labs/wallet-book');
|
|
15
|
+
require('../../constants/colors.cjs');
|
|
16
|
+
require('../../constants/values.cjs');
|
|
17
|
+
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
18
|
+
require('../../../shared/consts/index.cjs');
|
|
19
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
20
|
+
var embeddedWallets = require('../../../data/api/embeddedWallets/embeddedWallets.cjs');
|
|
21
|
+
require('../../../locale/locale.cjs');
|
|
8
22
|
|
|
9
23
|
const getCoinbaseMPCConnectorFetchers = ({ environmentId, authToken, }) => {
|
|
10
24
|
const fetchAuthToken = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
-
const token = yield
|
|
25
|
+
const token = yield embeddedWallets.getWalletAuthToken({
|
|
12
26
|
environmentId,
|
|
13
27
|
type: sdkApiCore.EmbeddedWalletAuthType.Mpc,
|
|
14
28
|
}, authToken);
|
|
15
29
|
return token || '';
|
|
16
30
|
});
|
|
17
31
|
const fetchBackupCode = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const token = yield
|
|
32
|
+
const token = yield embeddedWallets.getEmbeddedWalletBackup({
|
|
19
33
|
environmentId,
|
|
20
34
|
}, authToken);
|
|
21
35
|
return token || '';
|
|
22
36
|
});
|
|
23
37
|
const fetchPasscode = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
const token = yield
|
|
38
|
+
const token = yield embeddedWallets.getEmbeddedWalletPasscode({
|
|
25
39
|
environmentId,
|
|
26
40
|
}, authToken);
|
|
27
41
|
return token || '';
|
package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
2
|
import { EmbeddedWalletAuthType } from '@dynamic-labs/sdk-api-core';
|
|
3
|
-
import
|
|
3
|
+
import '@dynamic-labs/utils';
|
|
4
|
+
import '../../../shared/logger.js';
|
|
5
|
+
import '@dynamic-labs/iconic';
|
|
6
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
7
|
+
import 'react/jsx-runtime';
|
|
8
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import 'react';
|
|
10
|
+
import '@dynamic-labs/wallet-book';
|
|
11
|
+
import '../../constants/colors.js';
|
|
12
|
+
import '../../constants/values.js';
|
|
13
|
+
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
14
|
+
import '../../../shared/consts/index.js';
|
|
15
|
+
import '../../../config/ApiEndpoint.js';
|
|
16
|
+
import { getWalletAuthToken, getEmbeddedWalletBackup, getEmbeddedWalletPasscode } from '../../../data/api/embeddedWallets/embeddedWallets.js';
|
|
17
|
+
import '../../../locale/locale.js';
|
|
4
18
|
|
|
5
19
|
const getCoinbaseMPCConnectorFetchers = ({ environmentId, authToken, }) => {
|
|
6
20
|
const fetchAuthToken = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
6
|
-
|
|
7
|
-
require('@dynamic-labs/wallet-connector-core');
|
|
6
|
+
require('@dynamic-labs/utils');
|
|
8
7
|
require('@dynamic-labs/sdk-api-core');
|
|
9
8
|
require('../../../shared/logger.cjs');
|
|
10
9
|
require('@dynamic-labs/iconic');
|
|
10
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
11
11
|
require('react/jsx-runtime');
|
|
12
12
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
13
|
require('react');
|
|
@@ -15,8 +15,10 @@ require('@dynamic-labs/wallet-book');
|
|
|
15
15
|
require('../../constants/colors.cjs');
|
|
16
16
|
require('../../constants/values.cjs');
|
|
17
17
|
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
18
|
-
require('@dynamic-labs/utils');
|
|
19
18
|
require('../../../shared/consts/index.cjs');
|
|
19
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
20
|
+
require('../../../locale/locale.cjs');
|
|
21
|
+
var wallets = require('../../../data/api/wallets/wallets.cjs');
|
|
20
22
|
require('@dynamic-labs/multi-wallet');
|
|
21
23
|
var getMinAuthToken = require('../getMinAuthToken/getMinAuthToken.cjs');
|
|
22
24
|
require('react-international-phone');
|
|
@@ -34,7 +36,7 @@ const handleUnlinkHelper = ({ environmentId, primaryWalletId, walletId, }) => _t
|
|
|
34
36
|
const token = getMinAuthToken.getMinAuthToken();
|
|
35
37
|
if (!token)
|
|
36
38
|
return;
|
|
37
|
-
const response = yield
|
|
39
|
+
const response = yield wallets.unlinkWallet({ environmentId, primaryWalletId, walletId }, token);
|
|
38
40
|
return updateJWTAndCreateUserProfile.updateJWTAndCreateUserProfile(response === null || response === void 0 ? void 0 : response.jwt, response === null || response === void 0 ? void 0 : response.minifiedJwt);
|
|
39
41
|
});
|
|
40
42
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
|
-
import
|
|
3
|
-
import '@dynamic-labs/wallet-connector-core';
|
|
2
|
+
import '@dynamic-labs/utils';
|
|
4
3
|
import '@dynamic-labs/sdk-api-core';
|
|
5
4
|
import '../../../shared/logger.js';
|
|
6
5
|
import '@dynamic-labs/iconic';
|
|
6
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
7
7
|
import 'react/jsx-runtime';
|
|
8
8
|
import '../../../context/ViewContext/ViewContext.js';
|
|
9
9
|
import 'react';
|
|
@@ -11,8 +11,10 @@ import '@dynamic-labs/wallet-book';
|
|
|
11
11
|
import '../../constants/colors.js';
|
|
12
12
|
import '../../constants/values.js';
|
|
13
13
|
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
14
|
-
import '@dynamic-labs/utils';
|
|
15
14
|
import '../../../shared/consts/index.js';
|
|
15
|
+
import '../../../config/ApiEndpoint.js';
|
|
16
|
+
import '../../../locale/locale.js';
|
|
17
|
+
import { unlinkWallet } from '../../../data/api/wallets/wallets.js';
|
|
16
18
|
import '@dynamic-labs/multi-wallet';
|
|
17
19
|
import { getMinAuthToken } from '../getMinAuthToken/getMinAuthToken.js';
|
|
18
20
|
import 'react-international-phone';
|
|
@@ -26,7 +26,9 @@ require('@dynamic-labs/multi-wallet');
|
|
|
26
26
|
require('react-international-phone');
|
|
27
27
|
require('viem');
|
|
28
28
|
require('viem/chains');
|
|
29
|
-
var
|
|
29
|
+
var email = require('../../../../data/api/email/email.cjs');
|
|
30
|
+
require('../../../../config/ApiEndpoint.cjs');
|
|
31
|
+
var sms = require('../../../../data/api/sms/sms.cjs');
|
|
30
32
|
require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
31
33
|
require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
32
34
|
require('../../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
@@ -67,7 +69,6 @@ require('../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/Se
|
|
|
67
69
|
require('../../../../locale/locale.cjs');
|
|
68
70
|
require('@hcaptcha/react-hcaptcha');
|
|
69
71
|
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
70
|
-
require('../../../../config/ApiEndpoint.cjs');
|
|
71
72
|
require('../../../../context/FooterAnimationContext/index.cjs');
|
|
72
73
|
require('../../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs');
|
|
73
74
|
require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
@@ -95,7 +96,7 @@ const useOtpVerificationRequestRaw = () => {
|
|
|
95
96
|
if (!localVerificationUUID && !contextVerificationUUID)
|
|
96
97
|
throw new utils.DynamicError('No verification UUID is available');
|
|
97
98
|
const verificationUUID = (localVerificationUUID !== null && localVerificationUUID !== void 0 ? localVerificationUUID : contextVerificationUUID);
|
|
98
|
-
const verify = destination === 'email' ?
|
|
99
|
+
const verify = destination === 'email' ? email.verifyEmail : sms.verifySms;
|
|
99
100
|
const updateSelfResponse = yield verify({
|
|
100
101
|
environmentId,
|
|
101
102
|
verificationToken,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { HandleVerification, UpdateUserReturnPayload } from '../..';
|
|
2
|
-
|
|
3
|
-
export type VerifyOtp = (verificationToken: string, destination:
|
|
2
|
+
import { OtpDestination } from '../../../../shared';
|
|
3
|
+
export type VerifyOtp = (verificationToken: string, destination: OtpDestination, verificationUUID?: string) => Promise<UpdateUserReturnPayload>;
|
|
4
4
|
/**
|
|
5
5
|
* Same as useOtpVerificationRequest, but requires you to pass it a handleVerificationRequired method as param.
|
|
6
6
|
* This is to avoid a circular logic issue, as handleVerificationRequired needs to use the logic in this file as well.
|
|
7
7
|
*/
|
|
8
8
|
export declare const useOtpVerificationRequestRaw: () => {
|
|
9
|
-
verifyOtp: (handleVerificationRequired: HandleVerification, verificationToken: string, destination:
|
|
9
|
+
verifyOtp: (handleVerificationRequired: HandleVerification, verificationToken: string, destination: OtpDestination, localVerificationUUID?: string) => Promise<UpdateUserReturnPayload>;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* Hook to make verifications and already handle nuances like handling additional verifications
|
|
@@ -22,7 +22,9 @@ import '@dynamic-labs/multi-wallet';
|
|
|
22
22
|
import 'react-international-phone';
|
|
23
23
|
import 'viem';
|
|
24
24
|
import 'viem/chains';
|
|
25
|
-
import { verifyEmail
|
|
25
|
+
import { verifyEmail } from '../../../../data/api/email/email.js';
|
|
26
|
+
import '../../../../config/ApiEndpoint.js';
|
|
27
|
+
import { verifySms } from '../../../../data/api/sms/sms.js';
|
|
26
28
|
import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
27
29
|
import '../../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
28
30
|
import '../../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
@@ -63,7 +65,6 @@ import '../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/Sec
|
|
|
63
65
|
import '../../../../locale/locale.js';
|
|
64
66
|
import '@hcaptcha/react-hcaptcha';
|
|
65
67
|
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
66
|
-
import '../../../../config/ApiEndpoint.js';
|
|
67
68
|
import '../../../../context/FooterAnimationContext/index.js';
|
|
68
69
|
import '../../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js';
|
|
69
70
|
import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
@@ -7,7 +7,6 @@ var React = require('react');
|
|
|
7
7
|
var utils = require('@dynamic-labs/utils');
|
|
8
8
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
9
9
|
var UserWalletsContext = require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
10
|
-
var api = require('../../../data/api.cjs');
|
|
11
10
|
require('@dynamic-labs/sdk-api-core');
|
|
12
11
|
require('../../../shared/logger.cjs');
|
|
13
12
|
require('@dynamic-labs/iconic');
|
|
@@ -20,6 +19,9 @@ require('../../constants/values.cjs');
|
|
|
20
19
|
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
21
20
|
var useLocalStorage = require('../../../shared/utils/hooks/useLocalStorage/useLocalStorage.cjs');
|
|
22
21
|
require('../../../shared/consts/index.cjs');
|
|
22
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
23
|
+
var session = require('../../../data/api/session/session.cjs');
|
|
24
|
+
require('../../../locale/locale.cjs');
|
|
23
25
|
require('@dynamic-labs/multi-wallet');
|
|
24
26
|
require('react-international-phone');
|
|
25
27
|
var shouldManuallyReconnectOnRefresh = require('../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.cjs');
|
|
@@ -228,7 +230,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
228
230
|
// send information to backend to kick off background jobs
|
|
229
231
|
// so verify/sign on the next step could go by more quickly
|
|
230
232
|
// this is async work, but DO NOT AWAIT
|
|
231
|
-
|
|
233
|
+
session.createVisit({
|
|
232
234
|
authMode,
|
|
233
235
|
chain: walletChain || '',
|
|
234
236
|
environmentId,
|
|
@@ -3,7 +3,6 @@ import { useState, useCallback, useEffect } from 'react';
|
|
|
3
3
|
import { MissingPublicAddressError } from '@dynamic-labs/utils';
|
|
4
4
|
import { getWalletConnectorByKey, logger } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import { useInternalUserWallets } from '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
6
|
-
import { createVisit } from '../../../data/api.js';
|
|
7
6
|
import '@dynamic-labs/sdk-api-core';
|
|
8
7
|
import '../../../shared/logger.js';
|
|
9
8
|
import '@dynamic-labs/iconic';
|
|
@@ -16,6 +15,9 @@ import '../../constants/values.js';
|
|
|
16
15
|
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
17
16
|
import { useLocalStorage } from '../../../shared/utils/hooks/useLocalStorage/useLocalStorage.js';
|
|
18
17
|
import '../../../shared/consts/index.js';
|
|
18
|
+
import '../../../config/ApiEndpoint.js';
|
|
19
|
+
import { createVisit } from '../../../data/api/session/session.js';
|
|
20
|
+
import '../../../locale/locale.js';
|
|
19
21
|
import '@dynamic-labs/multi-wallet';
|
|
20
22
|
import 'react-international-phone';
|
|
21
23
|
import { shouldManuallyReconnectOnRefresh } from '../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.js';
|
|
@@ -26,7 +26,9 @@ var isProviderEnabled = require('../../functions/isProviderEnabled/isProviderEna
|
|
|
26
26
|
var isTurnkeyEnabled = require('../../functions/isTurnkeyEnabled/isTurnkeyEnabled.cjs');
|
|
27
27
|
require('viem');
|
|
28
28
|
require('viem/chains');
|
|
29
|
-
var
|
|
29
|
+
var email = require('../../../data/api/email/email.cjs');
|
|
30
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
31
|
+
require('../../../locale/locale.cjs');
|
|
30
32
|
require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
31
33
|
require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
32
34
|
require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
@@ -64,10 +66,8 @@ require('../../../views/WalletList/WalletList.cjs');
|
|
|
64
66
|
require('../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
65
67
|
var useConnectWithEmail = require('../useConnectWithEmail/useConnectWithEmail.cjs');
|
|
66
68
|
require('../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
67
|
-
require('../../../locale/locale.cjs');
|
|
68
69
|
require('@hcaptcha/react-hcaptcha');
|
|
69
70
|
require('../../../context/LoadingContext/LoadingContext.cjs');
|
|
70
|
-
require('../../../config/ApiEndpoint.cjs');
|
|
71
71
|
require('../../../context/FooterAnimationContext/index.cjs');
|
|
72
72
|
require('../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs');
|
|
73
73
|
require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
@@ -96,13 +96,13 @@ const useEmailProvider = ({ emailWalletConnector }) => {
|
|
|
96
96
|
(isProviderEnabled.isProviderEnabled(providers || [], sdkApiCore.ProviderEnum.MagicLink) ||
|
|
97
97
|
isProviderEnabled.isProviderEnabled(providers || [], sdkApiCore.ProviderEnum.Blocto));
|
|
98
98
|
const handleEmailOnlyLoginSubmit = (emailInput, captchaToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
99
|
-
const { email, verificationUUID } = yield
|
|
99
|
+
const { email: email$1, verificationUUID } = yield email.createEmailVerification({
|
|
100
100
|
captchaToken,
|
|
101
101
|
email: emailInput,
|
|
102
102
|
environmentId,
|
|
103
103
|
});
|
|
104
104
|
setView('login-with-email-verification');
|
|
105
|
-
setEmailForVerification(email);
|
|
105
|
+
setEmailForVerification(email$1);
|
|
106
106
|
setVerificationUUID(verificationUUID);
|
|
107
107
|
});
|
|
108
108
|
const handleMagicLinkOrBloctoSubmit = (emailInput) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -121,7 +121,7 @@ const useEmailProvider = ({ emailWalletConnector }) => {
|
|
|
121
121
|
(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.confirmEmailProviderForVerify)) {
|
|
122
122
|
// see: https://linear.app/dynamic-labs/issue/DYN-2517
|
|
123
123
|
// if confirmWalletTransfers setting is true, check api first to confirm emailProvider
|
|
124
|
-
const { emailProvider } = yield
|
|
124
|
+
const { emailProvider } = yield email.getEmailProvider({
|
|
125
125
|
email: emailInput,
|
|
126
126
|
environmentId,
|
|
127
127
|
});
|
|
@@ -22,7 +22,9 @@ import { isProviderEnabled } from '../../functions/isProviderEnabled/isProviderE
|
|
|
22
22
|
import { isTurnkeyEnabled } from '../../functions/isTurnkeyEnabled/isTurnkeyEnabled.js';
|
|
23
23
|
import 'viem';
|
|
24
24
|
import 'viem/chains';
|
|
25
|
-
import { getEmailProvider, createEmailVerification } from '../../../data/api.js';
|
|
25
|
+
import { getEmailProvider, createEmailVerification } from '../../../data/api/email/email.js';
|
|
26
|
+
import '../../../config/ApiEndpoint.js';
|
|
27
|
+
import '../../../locale/locale.js';
|
|
26
28
|
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
27
29
|
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
28
30
|
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
@@ -60,10 +62,8 @@ import '../../../views/WalletList/WalletList.js';
|
|
|
60
62
|
import '../../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
61
63
|
import { useConnectWithEmail } from '../useConnectWithEmail/useConnectWithEmail.js';
|
|
62
64
|
import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
63
|
-
import '../../../locale/locale.js';
|
|
64
65
|
import '@hcaptcha/react-hcaptcha';
|
|
65
66
|
import '../../../context/LoadingContext/LoadingContext.js';
|
|
66
|
-
import '../../../config/ApiEndpoint.js';
|
|
67
67
|
import '../../../context/FooterAnimationContext/index.js';
|
|
68
68
|
import '../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js';
|
|
69
69
|
import '../../../context/WalletGroupContext/WalletGroupContext.js';
|