@dynamic-labs/sdk-react-core 3.9.4 → 3.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/lib/components/TransactionCard/TransactionCard.cjs +3 -2
- package/src/lib/components/TransactionCard/TransactionCard.d.ts +1 -0
- package/src/lib/components/TransactionCard/TransactionCard.js +3 -2
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +2 -2
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.d.ts +1 -0
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +2 -2
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.cjs +7 -7
- package/src/lib/context/ConnectWithOtpContext/utils/createEmailHandler.js +7 -7
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.cjs +5 -5
- package/src/lib/context/ConnectWithOtpContext/utils/createSmsHandler.js +5 -5
- package/src/lib/context/ConnectWithOtpContext/utils/findEmailProvider.cjs +4 -4
- package/src/lib/context/ConnectWithOtpContext/utils/findEmailProvider.js +4 -4
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +6 -6
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +6 -6
- package/src/lib/context/FundingContext/FundingContext.cjs +5 -5
- package/src/lib/context/FundingContext/FundingContext.js +5 -5
- package/src/lib/data/api/email/email.cjs +17 -32
- package/src/lib/data/api/email/email.js +6 -21
- package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +21 -32
- package/src/lib/data/api/embeddedWallets/embeddedWallets.js +17 -28
- package/src/lib/data/api/externalAuth/externalAuth.cjs +10 -23
- package/src/lib/data/api/externalAuth/externalAuth.js +3 -16
- package/src/lib/data/api/mfa/mfa.cjs +15 -33
- package/src/lib/data/api/mfa/mfa.js +11 -29
- package/src/lib/data/api/oauth/oauth.cjs +11 -12
- package/src/lib/data/api/oauth/oauth.js +4 -5
- package/src/lib/data/api/session/session.cjs +7 -19
- package/src/lib/data/api/session/session.js +3 -15
- package/src/lib/data/api/sms/sms.cjs +14 -16
- package/src/lib/data/api/sms/sms.js +5 -7
- package/src/lib/data/api/user/user.cjs +13 -11
- package/src/lib/data/api/user/user.js +6 -4
- package/src/lib/data/api/utils.cjs +24 -0
- package/src/lib/data/api/utils.d.ts +1 -0
- package/src/lib/data/api/utils.js +24 -1
- package/src/lib/data/api/wallets/wallets.cjs +17 -28
- package/src/lib/data/api/wallets/wallets.js +6 -17
- package/src/lib/locale/en/translation.cjs +2 -1
- package/src/lib/locale/en/translation.d.ts +1 -0
- package/src/lib/locale/en/translation.js +2 -1
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +21 -7
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +22 -8
- package/src/lib/store/state/projectSettings/projectSettings.cjs +5 -5
- package/src/lib/store/state/projectSettings/projectSettings.js +5 -5
- package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.cjs +5 -5
- package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.js +5 -5
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +6 -6
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +6 -6
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.cjs +5 -5
- package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.js +5 -5
- package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.cjs +5 -5
- package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.js +5 -5
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.cjs +7 -7
- package/src/lib/utils/hooks/useFetchNonce/useFetchNonce.js +7 -7
- package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.cjs +3 -3
- package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.js +3 -3
- package/src/lib/utils/hooks/useMergeUserAccounts/useMergeUserAccounts.cjs +5 -5
- package/src/lib/utils/hooks/useMergeUserAccounts/useMergeUserAccounts.js +5 -5
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +2 -0
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +2 -0
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +6 -6
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +6 -6
- package/src/lib/views/Passkey/utils/createEmbeddedWalletRequest/createEmbeddedWalletRequest.cjs +6 -6
- package/src/lib/views/Passkey/utils/createEmbeddedWalletRequest/createEmbeddedWalletRequest.js +6 -6
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +8 -8
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +8 -8
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +5 -3
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +5 -3
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
|
+
import '@dynamic-labs/sdk-api-core';
|
|
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 '@dynamic-labs/utils';
|
|
12
|
+
import '../../utils/constants/colors.js';
|
|
13
|
+
import '../../utils/constants/values.js';
|
|
14
|
+
import '../../store/state/loadingAndLifecycle.js';
|
|
15
|
+
import '../../shared/consts/index.js';
|
|
3
16
|
import { sdkApi } from './api.js';
|
|
4
17
|
|
|
18
|
+
const logResponseError = (e, message) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
+
if (e instanceof Response) {
|
|
20
|
+
const data = yield e.json();
|
|
21
|
+
logger.error(message, { error: data.error, status: e.status });
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
24
|
+
else if (e instanceof Error) {
|
|
25
|
+
logger.error(message, e);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
5
28
|
const fetchNonce = (environmentId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
6
29
|
try {
|
|
7
30
|
const res = yield sdkApi().getNonce({
|
|
@@ -14,4 +37,4 @@ const fetchNonce = (environmentId) => __awaiter(void 0, void 0, void 0, function
|
|
|
14
37
|
}
|
|
15
38
|
});
|
|
16
39
|
|
|
17
|
-
export { fetchNonce };
|
|
40
|
+
export { fetchNonce, logResponseError };
|
|
@@ -5,21 +5,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
8
|
-
var utils = require('@dynamic-labs/utils');
|
|
9
|
-
var logger = require('../../../shared/logger.cjs');
|
|
10
|
-
require('@dynamic-labs/iconic');
|
|
11
|
-
require('@dynamic-labs/wallet-connector-core');
|
|
12
|
-
require('react/jsx-runtime');
|
|
13
|
-
require('../../../context/ViewContext/ViewContext.cjs');
|
|
14
|
-
require('react');
|
|
15
|
-
require('@dynamic-labs/wallet-book');
|
|
16
|
-
require('../../../utils/constants/colors.cjs');
|
|
17
|
-
require('../../../utils/constants/values.cjs');
|
|
18
|
-
require('../../../store/state/loadingAndLifecycle.cjs');
|
|
19
|
-
require('../../../shared/consts/index.cjs');
|
|
8
|
+
var utils$1 = require('@dynamic-labs/utils');
|
|
20
9
|
var api = require('../api.cjs');
|
|
21
10
|
var storeAuthTokenAndUser = require('../../../store/state/user/storeAuthTokenAndUser/storeAuthTokenAndUser.cjs');
|
|
22
11
|
require('../../../store/state/user/user.cjs');
|
|
12
|
+
var utils = require('../utils.cjs');
|
|
23
13
|
|
|
24
14
|
const storeSelectedWallet = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ environmentId, walletId, }) {
|
|
25
15
|
try {
|
|
@@ -33,7 +23,7 @@ const storeSelectedWallet = (_a) => _tslib.__awaiter(void 0, [_a], void 0, funct
|
|
|
33
23
|
return user;
|
|
34
24
|
}
|
|
35
25
|
catch (e) {
|
|
36
|
-
|
|
26
|
+
yield utils.logResponseError(e, 'Error storing selected wallet');
|
|
37
27
|
return undefined;
|
|
38
28
|
}
|
|
39
29
|
});
|
|
@@ -60,23 +50,22 @@ const linkWallet = (environmentId_1, _b) => _tslib.__awaiter(void 0, [environmen
|
|
|
60
50
|
return response;
|
|
61
51
|
}
|
|
62
52
|
catch (e) {
|
|
63
|
-
|
|
64
|
-
const data = yield e.json();
|
|
53
|
+
const data = yield utils.logResponseError(e, 'Error linkWallet');
|
|
65
54
|
if (data.code === 'reassign_wallet_confirm' ||
|
|
66
55
|
data.code === 'reassign_wallet_error') {
|
|
67
|
-
throw new utils.WalletUsedError(data.code);
|
|
56
|
+
throw new utils$1.WalletUsedError(data.code);
|
|
68
57
|
}
|
|
69
58
|
if (data.code === 'merge_accounts_confirmation') {
|
|
70
|
-
throw new utils.MergeAccountsConfirmationError({
|
|
59
|
+
throw new utils$1.MergeAccountsConfirmationError({
|
|
71
60
|
code: data.code,
|
|
72
61
|
mergeConflicts: data.payload.mergeConflicts,
|
|
73
62
|
walletAddress: publicWalletAddress,
|
|
74
63
|
});
|
|
75
64
|
}
|
|
76
65
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
77
|
-
throw new utils.SandboxMaximumThresholdReachedError(data.error.message);
|
|
66
|
+
throw new utils$1.SandboxMaximumThresholdReachedError(data.error.message);
|
|
78
67
|
}
|
|
79
|
-
throw new utils.DynamicError(data.error);
|
|
68
|
+
throw new utils$1.DynamicError(data.error);
|
|
80
69
|
}
|
|
81
70
|
});
|
|
82
71
|
const unlinkWallet = (_c) => _tslib.__awaiter(void 0, [_c], void 0, function* ({ environmentId, primaryWalletId, walletId, onSuccess, }) {
|
|
@@ -93,6 +82,7 @@ const unlinkWallet = (_c) => _tslib.__awaiter(void 0, [_c], void 0, function* ({
|
|
|
93
82
|
return user;
|
|
94
83
|
}
|
|
95
84
|
catch (e) {
|
|
85
|
+
yield utils.logResponseError(e, 'Error unlinkWallet');
|
|
96
86
|
return undefined;
|
|
97
87
|
}
|
|
98
88
|
});
|
|
@@ -117,7 +107,7 @@ const transferWallet = (environmentId_2, _d) => _tslib.__awaiter(void 0, [enviro
|
|
|
117
107
|
return user;
|
|
118
108
|
}
|
|
119
109
|
catch (e) {
|
|
120
|
-
|
|
110
|
+
yield utils.logResponseError(e, 'Error transfering wallet');
|
|
121
111
|
return undefined;
|
|
122
112
|
}
|
|
123
113
|
});
|
|
@@ -143,27 +133,26 @@ const verifyWallet = (environmentId_3, _e) => _tslib.__awaiter(void 0, [environm
|
|
|
143
133
|
return response;
|
|
144
134
|
}
|
|
145
135
|
catch (e) {
|
|
146
|
-
|
|
147
|
-
const data = yield e.json();
|
|
136
|
+
const data = yield utils.logResponseError(e, 'Error verifyWallet');
|
|
148
137
|
if (data.code === 'wallet_not_deployed') {
|
|
149
|
-
throw new utils.WalletNotDeployedError();
|
|
138
|
+
throw new utils$1.WalletNotDeployedError();
|
|
150
139
|
}
|
|
151
140
|
if (data.error.code === 'chainalysis_blocked_wallet') {
|
|
152
|
-
throw new utils.ChainalysisError(data.payload.walletPublicKey);
|
|
141
|
+
throw new utils$1.ChainalysisError(data.payload.walletPublicKey);
|
|
153
142
|
}
|
|
154
143
|
if (data.error.code === 'gate_blocked') {
|
|
155
|
-
throw new utils.GateBlockedError(data.payload.walletPublicKey);
|
|
144
|
+
throw new utils$1.GateBlockedError(data.payload.walletPublicKey);
|
|
156
145
|
}
|
|
157
146
|
if (data.error.code === 'missing_from_list') {
|
|
158
|
-
throw new utils.NoAccessError({
|
|
147
|
+
throw new utils$1.NoAccessError({
|
|
159
148
|
walletPublicKey: data.payload.walletPublicKey,
|
|
160
149
|
});
|
|
161
150
|
}
|
|
162
151
|
if (data.code === 'email_associated_with_different_provider') {
|
|
163
|
-
throw new utils.AccountExistsError(data.error, data.payload);
|
|
152
|
+
throw new utils$1.AccountExistsError(data.error, data.payload);
|
|
164
153
|
}
|
|
165
154
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
166
|
-
throw new utils.SandboxMaximumThresholdReachedError(data.error.message);
|
|
155
|
+
throw new utils$1.SandboxMaximumThresholdReachedError(data.error.message);
|
|
167
156
|
}
|
|
168
157
|
return undefined;
|
|
169
158
|
}
|
|
@@ -2,20 +2,10 @@
|
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { VerifyRequestFromJSON } from '@dynamic-labs/sdk-api-core';
|
|
4
4
|
import { WalletUsedError, MergeAccountsConfirmationError, SandboxMaximumThresholdReachedError, DynamicError, WalletNotDeployedError, ChainalysisError, GateBlockedError, NoAccessError, AccountExistsError } from '@dynamic-labs/utils';
|
|
5
|
-
import { logger } from '../../../shared/logger.js';
|
|
6
|
-
import '@dynamic-labs/iconic';
|
|
7
|
-
import '@dynamic-labs/wallet-connector-core';
|
|
8
|
-
import 'react/jsx-runtime';
|
|
9
|
-
import '../../../context/ViewContext/ViewContext.js';
|
|
10
|
-
import 'react';
|
|
11
|
-
import '@dynamic-labs/wallet-book';
|
|
12
|
-
import '../../../utils/constants/colors.js';
|
|
13
|
-
import '../../../utils/constants/values.js';
|
|
14
|
-
import '../../../store/state/loadingAndLifecycle.js';
|
|
15
|
-
import '../../../shared/consts/index.js';
|
|
16
5
|
import { sdkApi } from '../api.js';
|
|
17
6
|
import { storeAuthTokenAndUser } from '../../../store/state/user/storeAuthTokenAndUser/storeAuthTokenAndUser.js';
|
|
18
7
|
import '../../../store/state/user/user.js';
|
|
8
|
+
import { logResponseError } from '../utils.js';
|
|
19
9
|
|
|
20
10
|
const storeSelectedWallet = (_a) => __awaiter(void 0, [_a], void 0, function* ({ environmentId, walletId, }) {
|
|
21
11
|
try {
|
|
@@ -29,7 +19,7 @@ const storeSelectedWallet = (_a) => __awaiter(void 0, [_a], void 0, function* ({
|
|
|
29
19
|
return user;
|
|
30
20
|
}
|
|
31
21
|
catch (e) {
|
|
32
|
-
|
|
22
|
+
yield logResponseError(e, 'Error storing selected wallet');
|
|
33
23
|
return undefined;
|
|
34
24
|
}
|
|
35
25
|
});
|
|
@@ -56,8 +46,7 @@ const linkWallet = (environmentId_1, _b) => __awaiter(void 0, [environmentId_1,
|
|
|
56
46
|
return response;
|
|
57
47
|
}
|
|
58
48
|
catch (e) {
|
|
59
|
-
|
|
60
|
-
const data = yield e.json();
|
|
49
|
+
const data = yield logResponseError(e, 'Error linkWallet');
|
|
61
50
|
if (data.code === 'reassign_wallet_confirm' ||
|
|
62
51
|
data.code === 'reassign_wallet_error') {
|
|
63
52
|
throw new WalletUsedError(data.code);
|
|
@@ -89,6 +78,7 @@ const unlinkWallet = (_c) => __awaiter(void 0, [_c], void 0, function* ({ enviro
|
|
|
89
78
|
return user;
|
|
90
79
|
}
|
|
91
80
|
catch (e) {
|
|
81
|
+
yield logResponseError(e, 'Error unlinkWallet');
|
|
92
82
|
return undefined;
|
|
93
83
|
}
|
|
94
84
|
});
|
|
@@ -113,7 +103,7 @@ const transferWallet = (environmentId_2, _d) => __awaiter(void 0, [environmentId
|
|
|
113
103
|
return user;
|
|
114
104
|
}
|
|
115
105
|
catch (e) {
|
|
116
|
-
|
|
106
|
+
yield logResponseError(e, 'Error transfering wallet');
|
|
117
107
|
return undefined;
|
|
118
108
|
}
|
|
119
109
|
});
|
|
@@ -139,8 +129,7 @@ const verifyWallet = (environmentId_3, _e) => __awaiter(void 0, [environmentId_3
|
|
|
139
129
|
return response;
|
|
140
130
|
}
|
|
141
131
|
catch (e) {
|
|
142
|
-
|
|
143
|
-
const data = yield e.json();
|
|
132
|
+
const data = yield logResponseError(e, 'Error verifyWallet');
|
|
144
133
|
if (data.code === 'wallet_not_deployed') {
|
|
145
134
|
throw new WalletNotDeployedError();
|
|
146
135
|
}
|
|
@@ -1764,7 +1764,8 @@ const translation = {
|
|
|
1764
1764
|
total: 'Total',
|
|
1765
1765
|
wallet_used: 'Wallet used',
|
|
1766
1766
|
network: 'Network',
|
|
1767
|
-
|
|
1767
|
+
recipient: 'Recipient',
|
|
1768
|
+
destination: 'Interacting with',
|
|
1768
1769
|
gas_tooltip: 'Gas fees are charged by the network and can change quickly based on usage.',
|
|
1769
1770
|
sending: 'Sending',
|
|
1770
1771
|
receiving: 'Receiving',
|
|
@@ -1760,7 +1760,8 @@ const translation = {
|
|
|
1760
1760
|
total: 'Total',
|
|
1761
1761
|
wallet_used: 'Wallet used',
|
|
1762
1762
|
network: 'Network',
|
|
1763
|
-
|
|
1763
|
+
recipient: 'Recipient',
|
|
1764
|
+
destination: 'Interacting with',
|
|
1764
1765
|
gas_tooltip: 'Gas fees are charged by the network and can change quickly based on usage.',
|
|
1765
1766
|
sending: 'Sending',
|
|
1766
1767
|
receiving: 'Receiving',
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
+
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
6
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
8
|
var React = require('react');
|
|
8
9
|
var utils = require('@dynamic-labs/utils');
|
|
9
10
|
require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
10
11
|
require('../../components/Alert/Alert.cjs');
|
|
11
12
|
require('../../events/dynamicEvents.cjs');
|
|
12
|
-
require('../../../../_virtual/_tslib.cjs');
|
|
13
13
|
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
14
14
|
require('@dynamic-labs/sdk-api-core');
|
|
15
15
|
require('../../shared/logger.cjs');
|
|
@@ -84,27 +84,41 @@ require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
|
84
84
|
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
85
85
|
require('@hcaptcha/react-hcaptcha');
|
|
86
86
|
|
|
87
|
-
const
|
|
87
|
+
const TransactionModalContent = ({ title, onReject, onTransactionResponseSuccess, transaction, copykey, walletConnector, hideModal, isNativeToken, currentToken, }) => {
|
|
88
88
|
usePreventPageScroll.usePreventPageScroll(true);
|
|
89
|
-
const [show, setShow] = React.useState(true);
|
|
90
89
|
const errorRef = React.useRef(null);
|
|
91
90
|
const transactionResponseRef = React.useRef(null);
|
|
91
|
+
const isClosingRef = React.useRef(false);
|
|
92
|
+
const isTransactionPendingRef = React.useRef(false);
|
|
93
|
+
const [show, setShow] = React.useState(true);
|
|
92
94
|
const closeModal = React.useCallback(() => {
|
|
95
|
+
if (transactionResponseRef.current) {
|
|
96
|
+
onTransactionResponseSuccess(transactionResponseRef.current);
|
|
97
|
+
}
|
|
98
|
+
isClosingRef.current = true;
|
|
93
99
|
setShow(false);
|
|
94
|
-
}, [
|
|
100
|
+
}, [onTransactionResponseSuccess]);
|
|
95
101
|
const handleOnModalUnmount = React.useCallback(() => {
|
|
96
102
|
if (transactionResponseRef.current) {
|
|
97
103
|
return onTransactionResponseSuccess(transactionResponseRef.current);
|
|
98
104
|
}
|
|
99
105
|
return onReject(errorRef.current || new utils.UserRejectedTransactionError());
|
|
100
106
|
}, [onTransactionResponseSuccess, onReject]);
|
|
107
|
+
if (isClosingRef.current)
|
|
108
|
+
return null;
|
|
101
109
|
return (jsxRuntime.jsx(Portal.Portal, { handleClose: closeModal, isShown: show, zIndex: index.authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
|
|
102
110
|
onUnmount: handleOnModalUnmount,
|
|
103
|
-
}, children: jsxRuntime.jsx(Modal.Modal, { children: jsxRuntime.jsx(ModalCard.ModalCard, { children: jsxRuntime.jsx(TransactionConfirmationView.TransactionConfirmationView, { transaction: transaction, title: title, copykey: copykey, hideModal: hideModal, mutation: () =>
|
|
104
|
-
|
|
105
|
-
|
|
111
|
+
}, children: jsxRuntime.jsx(Modal.Modal, { children: jsxRuntime.jsx(ModalCard.ModalCard, { children: jsxRuntime.jsx(TransactionConfirmationView.TransactionConfirmationView, { transaction: transaction, title: title, copykey: copykey, hideModal: hideModal, mutation: () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
112
|
+
isTransactionPendingRef.current = true;
|
|
113
|
+
return transaction.submit();
|
|
114
|
+
}), onClickClose: closeModal, onError: (error) => (errorRef.current = error), displayPoweredByDynamicFooter: true, walletConnector: walletConnector, onSuccess: (receipt) => {
|
|
115
|
+
transactionResponseRef.current = receipt;
|
|
116
|
+
isTransactionPendingRef.current = false;
|
|
106
117
|
closeModal();
|
|
107
118
|
}, isNativeToken: isNativeToken, currentToken: currentToken, isModal: true }) }) }) }));
|
|
108
119
|
};
|
|
120
|
+
const TransactionConfirmationModal = (props) => (jsxRuntime.jsx(TransactionModalContent
|
|
121
|
+
// force re-render for each new transaction
|
|
122
|
+
, Object.assign({}, props), `${props.transaction.to}-${Date.now()}`));
|
|
109
123
|
|
|
110
124
|
exports.TransactionConfirmationModal = TransactionConfirmationModal;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
2
3
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
4
|
+
import { useRef, useState, useCallback } from 'react';
|
|
4
5
|
import { UserRejectedTransactionError } from '@dynamic-labs/utils';
|
|
5
6
|
import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
6
7
|
import '../../components/Alert/Alert.js';
|
|
7
8
|
import '../../events/dynamicEvents.js';
|
|
8
|
-
import '../../../../_virtual/_tslib.js';
|
|
9
9
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
10
10
|
import '@dynamic-labs/sdk-api-core';
|
|
11
11
|
import '../../shared/logger.js';
|
|
@@ -80,27 +80,41 @@ import '../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
|
80
80
|
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
81
81
|
import '@hcaptcha/react-hcaptcha';
|
|
82
82
|
|
|
83
|
-
const
|
|
83
|
+
const TransactionModalContent = ({ title, onReject, onTransactionResponseSuccess, transaction, copykey, walletConnector, hideModal, isNativeToken, currentToken, }) => {
|
|
84
84
|
usePreventPageScroll(true);
|
|
85
|
-
const [show, setShow] = useState(true);
|
|
86
85
|
const errorRef = useRef(null);
|
|
87
86
|
const transactionResponseRef = useRef(null);
|
|
87
|
+
const isClosingRef = useRef(false);
|
|
88
|
+
const isTransactionPendingRef = useRef(false);
|
|
89
|
+
const [show, setShow] = useState(true);
|
|
88
90
|
const closeModal = useCallback(() => {
|
|
91
|
+
if (transactionResponseRef.current) {
|
|
92
|
+
onTransactionResponseSuccess(transactionResponseRef.current);
|
|
93
|
+
}
|
|
94
|
+
isClosingRef.current = true;
|
|
89
95
|
setShow(false);
|
|
90
|
-
}, [
|
|
96
|
+
}, [onTransactionResponseSuccess]);
|
|
91
97
|
const handleOnModalUnmount = useCallback(() => {
|
|
92
98
|
if (transactionResponseRef.current) {
|
|
93
99
|
return onTransactionResponseSuccess(transactionResponseRef.current);
|
|
94
100
|
}
|
|
95
101
|
return onReject(errorRef.current || new UserRejectedTransactionError());
|
|
96
102
|
}, [onTransactionResponseSuccess, onReject]);
|
|
103
|
+
if (isClosingRef.current)
|
|
104
|
+
return null;
|
|
97
105
|
return (jsx(Portal, { handleClose: closeModal, isShown: show, zIndex: authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
|
|
98
106
|
onUnmount: handleOnModalUnmount,
|
|
99
|
-
}, children: jsx(Modal, { children: jsx(ModalCard, { children: jsx(TransactionConfirmationView, { transaction: transaction, title: title, copykey: copykey, hideModal: hideModal, mutation: () =>
|
|
100
|
-
|
|
101
|
-
|
|
107
|
+
}, children: jsx(Modal, { children: jsx(ModalCard, { children: jsx(TransactionConfirmationView, { transaction: transaction, title: title, copykey: copykey, hideModal: hideModal, mutation: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
108
|
+
isTransactionPendingRef.current = true;
|
|
109
|
+
return transaction.submit();
|
|
110
|
+
}), onClickClose: closeModal, onError: (error) => (errorRef.current = error), displayPoweredByDynamicFooter: true, walletConnector: walletConnector, onSuccess: (receipt) => {
|
|
111
|
+
transactionResponseRef.current = receipt;
|
|
112
|
+
isTransactionPendingRef.current = false;
|
|
102
113
|
closeModal();
|
|
103
114
|
}, isNativeToken: isNativeToken, currentToken: currentToken, isModal: true }) }) }) }));
|
|
104
115
|
};
|
|
116
|
+
const TransactionConfirmationModal = (props) => (jsx(TransactionModalContent
|
|
117
|
+
// force re-render for each new transaction
|
|
118
|
+
, Object.assign({}, props), `${props.transaction.to}-${Date.now()}`));
|
|
105
119
|
|
|
106
120
|
export { TransactionConfirmationModal };
|
|
@@ -6,20 +6,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var utils = require('@dynamic-labs/utils');
|
|
8
8
|
require('@dynamic-labs/sdk-api-core');
|
|
9
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
10
|
+
require('../../../utils/constants/values.cjs');
|
|
11
|
+
require('@dynamic-labs/multi-wallet');
|
|
9
12
|
require('../../../shared/logger.cjs');
|
|
13
|
+
require('../../../utils/constants/colors.cjs');
|
|
14
|
+
require('react-international-phone');
|
|
10
15
|
require('@dynamic-labs/iconic');
|
|
11
16
|
require('@dynamic-labs/wallet-connector-core');
|
|
12
17
|
require('react/jsx-runtime');
|
|
13
18
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
14
19
|
require('react');
|
|
15
20
|
require('@dynamic-labs/wallet-book');
|
|
16
|
-
require('../../../utils/constants/colors.cjs');
|
|
17
|
-
require('../../../utils/constants/values.cjs');
|
|
18
21
|
require('../loadingAndLifecycle.cjs');
|
|
19
22
|
require('../../../shared/consts/index.cjs');
|
|
20
|
-
require('../../../config/ApiEndpoint.cjs');
|
|
21
|
-
require('@dynamic-labs/multi-wallet');
|
|
22
|
-
require('react-international-phone');
|
|
23
23
|
require('../user/user.cjs');
|
|
24
24
|
var settings = require('../../../data/api/settings/settings.cjs');
|
|
25
25
|
require('../../../locale/locale.cjs');
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { DynamicError } from '@dynamic-labs/utils';
|
|
4
4
|
import '@dynamic-labs/sdk-api-core';
|
|
5
|
+
import '../../../config/ApiEndpoint.js';
|
|
6
|
+
import '../../../utils/constants/values.js';
|
|
7
|
+
import '@dynamic-labs/multi-wallet';
|
|
5
8
|
import '../../../shared/logger.js';
|
|
9
|
+
import '../../../utils/constants/colors.js';
|
|
10
|
+
import 'react-international-phone';
|
|
6
11
|
import '@dynamic-labs/iconic';
|
|
7
12
|
import '@dynamic-labs/wallet-connector-core';
|
|
8
13
|
import 'react/jsx-runtime';
|
|
9
14
|
import '../../../context/ViewContext/ViewContext.js';
|
|
10
15
|
import 'react';
|
|
11
16
|
import '@dynamic-labs/wallet-book';
|
|
12
|
-
import '../../../utils/constants/colors.js';
|
|
13
|
-
import '../../../utils/constants/values.js';
|
|
14
17
|
import '../loadingAndLifecycle.js';
|
|
15
18
|
import '../../../shared/consts/index.js';
|
|
16
|
-
import '../../../config/ApiEndpoint.js';
|
|
17
|
-
import '@dynamic-labs/multi-wallet';
|
|
18
|
-
import 'react-international-phone';
|
|
19
19
|
import '../user/user.js';
|
|
20
20
|
import { fetchProjectSettings } from '../../../data/api/settings/settings.js';
|
|
21
21
|
import '../../../locale/locale.js';
|
package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.cjs
CHANGED
|
@@ -6,20 +6,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
8
8
|
require('@dynamic-labs/utils');
|
|
9
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
10
|
+
require('../../constants/values.cjs');
|
|
11
|
+
require('@dynamic-labs/multi-wallet');
|
|
9
12
|
require('../../../shared/logger.cjs');
|
|
13
|
+
require('../../constants/colors.cjs');
|
|
14
|
+
require('react-international-phone');
|
|
10
15
|
require('@dynamic-labs/iconic');
|
|
11
16
|
require('@dynamic-labs/wallet-connector-core');
|
|
12
17
|
require('react/jsx-runtime');
|
|
13
18
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
14
19
|
require('react');
|
|
15
20
|
require('@dynamic-labs/wallet-book');
|
|
16
|
-
require('../../constants/colors.cjs');
|
|
17
|
-
require('../../constants/values.cjs');
|
|
18
21
|
require('../../../store/state/loadingAndLifecycle.cjs');
|
|
19
22
|
require('../../../shared/consts/index.cjs');
|
|
20
|
-
require('../../../config/ApiEndpoint.cjs');
|
|
21
|
-
require('@dynamic-labs/multi-wallet');
|
|
22
|
-
require('react-international-phone');
|
|
23
23
|
require('../../../store/state/projectSettings/projectSettings.cjs');
|
|
24
24
|
var embeddedWallets = require('../../../data/api/embeddedWallets/embeddedWallets.cjs');
|
|
25
25
|
require('../../../store/state/user/user.cjs');
|
package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.js
CHANGED
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { EmbeddedWalletAuthType } from '@dynamic-labs/sdk-api-core';
|
|
4
4
|
import '@dynamic-labs/utils';
|
|
5
|
+
import '../../../config/ApiEndpoint.js';
|
|
6
|
+
import '../../constants/values.js';
|
|
7
|
+
import '@dynamic-labs/multi-wallet';
|
|
5
8
|
import '../../../shared/logger.js';
|
|
9
|
+
import '../../constants/colors.js';
|
|
10
|
+
import 'react-international-phone';
|
|
6
11
|
import '@dynamic-labs/iconic';
|
|
7
12
|
import '@dynamic-labs/wallet-connector-core';
|
|
8
13
|
import 'react/jsx-runtime';
|
|
9
14
|
import '../../../context/ViewContext/ViewContext.js';
|
|
10
15
|
import 'react';
|
|
11
16
|
import '@dynamic-labs/wallet-book';
|
|
12
|
-
import '../../constants/colors.js';
|
|
13
|
-
import '../../constants/values.js';
|
|
14
17
|
import '../../../store/state/loadingAndLifecycle.js';
|
|
15
18
|
import '../../../shared/consts/index.js';
|
|
16
|
-
import '../../../config/ApiEndpoint.js';
|
|
17
|
-
import '@dynamic-labs/multi-wallet';
|
|
18
|
-
import 'react-international-phone';
|
|
19
19
|
import '../../../store/state/projectSettings/projectSettings.js';
|
|
20
20
|
import { getWalletAuthToken, getEmbeddedWalletBackup, getEmbeddedWalletPasscode } from '../../../data/api/embeddedWallets/embeddedWallets.js';
|
|
21
21
|
import '../../../store/state/user/user.js';
|
|
@@ -9,20 +9,20 @@ var utils = require('@dynamic-labs/utils');
|
|
|
9
9
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
10
10
|
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
11
11
|
var UserWalletsContext = require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
12
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
13
|
+
require('../../constants/values.cjs');
|
|
14
|
+
require('@dynamic-labs/multi-wallet');
|
|
15
|
+
var localStorage = require('../../constants/localStorage.cjs');
|
|
12
16
|
require('../../../shared/logger.cjs');
|
|
17
|
+
require('../../constants/colors.cjs');
|
|
18
|
+
require('react-international-phone');
|
|
13
19
|
require('@dynamic-labs/iconic');
|
|
14
20
|
require('react/jsx-runtime');
|
|
15
21
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
16
22
|
require('@dynamic-labs/wallet-book');
|
|
17
|
-
var localStorage = require('../../constants/localStorage.cjs');
|
|
18
|
-
require('../../constants/colors.cjs');
|
|
19
|
-
require('../../constants/values.cjs');
|
|
20
23
|
require('../../../store/state/loadingAndLifecycle.cjs');
|
|
21
24
|
var useLocalStorage = require('../../../shared/utils/hooks/useLocalStorage/useLocalStorage.cjs');
|
|
22
25
|
require('../../../shared/consts/index.cjs');
|
|
23
|
-
require('../../../config/ApiEndpoint.cjs');
|
|
24
|
-
require('@dynamic-labs/multi-wallet');
|
|
25
|
-
require('react-international-phone');
|
|
26
26
|
var shouldManuallyReconnectOnRefresh = require('../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.cjs');
|
|
27
27
|
require('../../../store/state/projectSettings/projectSettings.cjs');
|
|
28
28
|
require('../../../store/state/user/user.cjs');
|
|
@@ -5,20 +5,20 @@ import { MissingPublicAddressError } from '@dynamic-labs/utils';
|
|
|
5
5
|
import { getWalletConnectorByKey, logger, isHardwareWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
6
6
|
import { HardwareWalletEnum } from '@dynamic-labs/sdk-api-core';
|
|
7
7
|
import { useInternalUserWallets } from '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
8
|
+
import '../../../config/ApiEndpoint.js';
|
|
9
|
+
import '../../constants/values.js';
|
|
10
|
+
import '@dynamic-labs/multi-wallet';
|
|
11
|
+
import { CONNECTED_WALLETS_INFO } from '../../constants/localStorage.js';
|
|
8
12
|
import '../../../shared/logger.js';
|
|
13
|
+
import '../../constants/colors.js';
|
|
14
|
+
import 'react-international-phone';
|
|
9
15
|
import '@dynamic-labs/iconic';
|
|
10
16
|
import 'react/jsx-runtime';
|
|
11
17
|
import '../../../context/ViewContext/ViewContext.js';
|
|
12
18
|
import '@dynamic-labs/wallet-book';
|
|
13
|
-
import { CONNECTED_WALLETS_INFO } from '../../constants/localStorage.js';
|
|
14
|
-
import '../../constants/colors.js';
|
|
15
|
-
import '../../constants/values.js';
|
|
16
19
|
import '../../../store/state/loadingAndLifecycle.js';
|
|
17
20
|
import { useLocalStorage } from '../../../shared/utils/hooks/useLocalStorage/useLocalStorage.js';
|
|
18
21
|
import '../../../shared/consts/index.js';
|
|
19
|
-
import '../../../config/ApiEndpoint.js';
|
|
20
|
-
import '@dynamic-labs/multi-wallet';
|
|
21
|
-
import 'react-international-phone';
|
|
22
22
|
import { shouldManuallyReconnectOnRefresh } from '../../functions/shouldManuallyReconnectOnRefresh/shouldManuallyReconnectOnRefresh.js';
|
|
23
23
|
import '../../../store/state/projectSettings/projectSettings.js';
|
|
24
24
|
import '../../../store/state/user/user.js';
|
|
@@ -9,19 +9,19 @@ var utils = require('@dynamic-labs/utils');
|
|
|
9
9
|
var sessionStorage = require('../../constants/sessionStorage.cjs');
|
|
10
10
|
var utils$1 = require('../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/utils.cjs');
|
|
11
11
|
require('@dynamic-labs/sdk-api-core');
|
|
12
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
13
|
+
require('../../constants/values.cjs');
|
|
14
|
+
require('@dynamic-labs/multi-wallet');
|
|
12
15
|
require('../../../shared/logger.cjs');
|
|
16
|
+
require('../../constants/colors.cjs');
|
|
17
|
+
require('react-international-phone');
|
|
13
18
|
require('@dynamic-labs/iconic');
|
|
14
19
|
require('@dynamic-labs/wallet-connector-core');
|
|
15
20
|
require('react/jsx-runtime');
|
|
16
21
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
17
22
|
require('@dynamic-labs/wallet-book');
|
|
18
|
-
require('../../constants/colors.cjs');
|
|
19
|
-
require('../../constants/values.cjs');
|
|
20
23
|
require('../../../store/state/loadingAndLifecycle.cjs');
|
|
21
24
|
require('../../../shared/consts/index.cjs');
|
|
22
|
-
require('../../../config/ApiEndpoint.cjs');
|
|
23
|
-
require('@dynamic-labs/multi-wallet');
|
|
24
|
-
require('react-international-phone');
|
|
25
25
|
require('../../../store/state/projectSettings/projectSettings.cjs');
|
|
26
26
|
var embeddedWallets = require('../../../data/api/embeddedWallets/embeddedWallets.cjs');
|
|
27
27
|
require('../../../store/state/user/user.cjs');
|
|
@@ -5,19 +5,19 @@ import { StorageService } from '@dynamic-labs/utils';
|
|
|
5
5
|
import { SECURE_ENCLAVE_WALLET_SESSION_KEYS, SECURE_ENCLAVE_WALLET_SESSION_KEYS_STORAGE_OPTIONS } from '../../constants/sessionStorage.js';
|
|
6
6
|
import { p256Keygen } from '../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/utils.js';
|
|
7
7
|
import '@dynamic-labs/sdk-api-core';
|
|
8
|
+
import '../../../config/ApiEndpoint.js';
|
|
9
|
+
import '../../constants/values.js';
|
|
10
|
+
import '@dynamic-labs/multi-wallet';
|
|
8
11
|
import '../../../shared/logger.js';
|
|
12
|
+
import '../../constants/colors.js';
|
|
13
|
+
import 'react-international-phone';
|
|
9
14
|
import '@dynamic-labs/iconic';
|
|
10
15
|
import '@dynamic-labs/wallet-connector-core';
|
|
11
16
|
import 'react/jsx-runtime';
|
|
12
17
|
import '../../../context/ViewContext/ViewContext.js';
|
|
13
18
|
import '@dynamic-labs/wallet-book';
|
|
14
|
-
import '../../constants/colors.js';
|
|
15
|
-
import '../../constants/values.js';
|
|
16
19
|
import '../../../store/state/loadingAndLifecycle.js';
|
|
17
20
|
import '../../../shared/consts/index.js';
|
|
18
|
-
import '../../../config/ApiEndpoint.js';
|
|
19
|
-
import '@dynamic-labs/multi-wallet';
|
|
20
|
-
import 'react-international-phone';
|
|
21
21
|
import '../../../store/state/projectSettings/projectSettings.js';
|
|
22
22
|
import { registerSessionKey } from '../../../data/api/embeddedWallets/embeddedWallets.js';
|
|
23
23
|
import '../../../store/state/user/user.js';
|
|
@@ -7,20 +7,20 @@ var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
require('@dynamic-labs/utils');
|
|
9
9
|
require('@dynamic-labs/sdk-api-core');
|
|
10
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
11
|
+
require('../../constants/values.cjs');
|
|
12
|
+
require('@dynamic-labs/multi-wallet');
|
|
10
13
|
require('../../../shared/logger.cjs');
|
|
14
|
+
require('../../constants/colors.cjs');
|
|
15
|
+
require('react-international-phone');
|
|
11
16
|
require('@dynamic-labs/iconic');
|
|
12
17
|
require('@dynamic-labs/wallet-connector-core');
|
|
13
18
|
require('react/jsx-runtime');
|
|
14
19
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
15
20
|
require('@dynamic-labs/wallet-book');
|
|
16
|
-
require('../../constants/colors.cjs');
|
|
17
|
-
require('../../constants/values.cjs');
|
|
18
21
|
var hasPendingRequirements = require('../../../shared/utils/functions/hasPendingRequirements/hasPendingRequirements.cjs');
|
|
19
22
|
require('../../../store/state/loadingAndLifecycle.cjs');
|
|
20
23
|
require('../../../shared/consts/index.cjs');
|
|
21
|
-
require('../../../config/ApiEndpoint.cjs');
|
|
22
|
-
require('@dynamic-labs/multi-wallet');
|
|
23
|
-
require('react-international-phone');
|
|
24
24
|
require('../../../store/state/projectSettings/projectSettings.cjs');
|
|
25
25
|
require('../../../store/state/user/user.cjs');
|
|
26
26
|
var externalAuth = require('../../../data/api/externalAuth/externalAuth.cjs');
|