@dynamic-labs/sdk-react-core 0.18.100-viem.2 → 0.18.100-viem.20
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 +171 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +10 -10
- package/src/index.cjs +3 -2
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -1
- package/src/lib/components/MenuList/Dropdown/Dropdown.cjs +1 -1
- package/src/lib/components/MenuList/Dropdown/Dropdown.js +1 -1
- package/src/lib/components/ModalHeaderBanner/ModalHeaderBanner.cjs +6 -2
- package/src/lib/components/ModalHeaderBanner/ModalHeaderBanner.d.ts +2 -1
- package/src/lib/components/ModalHeaderBanner/ModalHeaderBanner.js +6 -2
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +2 -2
- package/src/lib/components/OTPVerificationView/OTPVerificationView.d.ts +1 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +2 -2
- package/src/lib/components/SignMessagePreview/SignMessagePreview.cjs +27 -0
- package/src/lib/components/SignMessagePreview/SignMessagePreview.d.ts +6 -0
- package/src/lib/components/SignMessagePreview/SignMessagePreview.js +23 -0
- package/src/lib/components/SignMessagePreview/SignMessagePreview.types.d.ts +8 -0
- package/src/lib/components/SignMessagePreview/components/SignTypedDataPreview/SignTypedDataPreview.cjs +44 -0
- package/src/lib/components/SignMessagePreview/components/SignTypedDataPreview/SignTypedDataPreview.d.ts +8 -0
- package/src/lib/components/SignMessagePreview/components/SignTypedDataPreview/SignTypedDataPreview.js +40 -0
- package/src/lib/components/SignMessagePreview/components/SignTypedDataPreview/index.d.ts +1 -0
- package/src/lib/components/SignMessagePreview/components/index.d.ts +1 -0
- package/src/lib/components/SignMessagePreview/index.d.ts +1 -0
- package/src/lib/components/SignMessagePreview/utils/index.d.ts +1 -0
- package/src/lib/components/SignMessagePreview/utils/isSignTypedData/index.d.ts +1 -0
- package/src/lib/components/SignMessagePreview/utils/isSignTypedData/isSignTypedData.cjs +17 -0
- package/src/lib/components/SignMessagePreview/utils/isSignTypedData/isSignTypedData.d.ts +2 -0
- package/src/lib/components/SignMessagePreview/utils/isSignTypedData/isSignTypedData.js +13 -0
- package/src/lib/components/Typography/Typography.cjs +1 -0
- package/src/lib/components/Typography/Typography.js +1 -0
- package/src/lib/components/Typography/Typography.types.d.ts +1 -1
- package/src/lib/components/UserProfile/UserProfile.cjs +1 -1
- package/src/lib/components/UserProfile/UserProfile.js +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -1
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +22 -7
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +11 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +23 -8
- package/src/lib/context/DynamicContext/helpers.cjs +42 -3
- package/src/lib/context/DynamicContext/helpers.d.ts +7 -1
- package/src/lib/context/DynamicContext/helpers.js +38 -4
- package/src/lib/context/DynamicContext/hooks/useSetShowAuthFlowWithInit/useSetShowAuthFlowWithInit.cjs +5 -2
- package/src/lib/context/DynamicContext/hooks/useSetShowAuthFlowWithInit/useSetShowAuthFlowWithInit.d.ts +4 -2
- package/src/lib/context/DynamicContext/hooks/useSetShowAuthFlowWithInit/useSetShowAuthFlowWithInit.js +5 -2
- package/src/lib/context/DynamicContext/internalEvents/index.d.ts +2 -0
- package/src/lib/context/DynamicContext/internalEvents/internalEvents.cjs +14 -0
- package/src/lib/context/DynamicContext/internalEvents/internalEvents.d.ts +8 -0
- package/src/lib/context/DynamicContext/internalEvents/internalEvents.js +6 -0
- package/src/lib/context/DynamicContext/types/index.d.ts +7 -1
- package/src/lib/context/DynamicContext/useDynamicContext.cjs +2 -1
- package/src/lib/context/DynamicContext/useDynamicContext.d.ts +1 -1
- package/src/lib/context/DynamicContext/useDynamicContext.js +2 -1
- package/src/lib/context/ErrorContext/ErrorContext.cjs +1 -0
- package/src/lib/context/ErrorContext/ErrorContext.js +1 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +2 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +2 -1
- package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
- package/src/lib/context/WalletContext/WalletContext.cjs +2 -16
- package/src/lib/context/WalletContext/WalletContext.js +2 -16
- package/src/lib/data/api.cjs +37 -13
- package/src/lib/data/api.d.ts +5 -3
- package/src/lib/data/api.js +37 -14
- package/src/lib/main.global.cjs +1 -1
- package/src/lib/main.global.js +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +2 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +2 -1
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +2 -1
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +2 -1
- package/src/lib/shared/types/index.d.ts +4 -0
- package/src/lib/shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.cjs +28 -2
- package/src/lib/shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.js +28 -2
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/localStorage.cjs +4 -0
- package/src/lib/utils/constants/localStorage.d.ts +2 -0
- package/src/lib/utils/constants/localStorage.js +3 -1
- package/src/lib/utils/functions/createUserProfile/createUserProfile.cjs +1 -1
- package/src/lib/utils/functions/createUserProfile/createUserProfile.js +1 -1
- package/src/lib/utils/functions/digestSHA256/digestSHA256.cjs +11 -0
- package/src/lib/utils/functions/digestSHA256/digestSHA256.d.ts +1 -0
- package/src/lib/utils/functions/digestSHA256/digestSHA256.js +7 -0
- package/src/lib/utils/functions/digestSHA256/index.d.ts +1 -0
- package/src/lib/utils/functions/encodeBase64URL/encodeBase64URL.cjs +14 -0
- package/src/lib/utils/functions/encodeBase64URL/encodeBase64URL.d.ts +1 -0
- package/src/lib/utils/functions/encodeBase64URL/encodeBase64URL.js +10 -0
- package/src/lib/utils/functions/encodeBase64URL/index.d.ts +1 -0
- package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.cjs +6 -1
- package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.js +6 -1
- package/src/lib/utils/functions/getRedirectURIOrigin/getRedirectURIOrigin.cjs +33 -0
- package/src/lib/utils/functions/getRedirectURIOrigin/getRedirectURIOrigin.d.ts +1 -0
- package/src/lib/utils/functions/getRedirectURIOrigin/getRedirectURIOrigin.js +29 -0
- package/src/lib/utils/functions/getRedirectURIOrigin/index.d.ts +1 -0
- package/src/lib/utils/functions/index.d.ts +6 -0
- package/src/lib/utils/functions/randomString/index.d.ts +1 -0
- package/src/lib/utils/functions/randomString/randomString.cjs +14 -0
- package/src/lib/utils/functions/randomString/randomString.d.ts +1 -0
- package/src/lib/utils/functions/randomString/randomString.js +10 -0
- package/src/lib/utils/functions/sendTransactionWithAutoNonce/index.d.ts +1 -0
- package/src/lib/utils/functions/sendTransactionWithAutoNonce/sendTransactionWithAutoNonce.cjs +48 -0
- package/src/lib/utils/functions/sendTransactionWithAutoNonce/sendTransactionWithAutoNonce.d.ts +18 -0
- package/src/lib/utils/functions/sendTransactionWithAutoNonce/sendTransactionWithAutoNonce.js +43 -0
- package/src/lib/utils/functions/stringifyURIQuery/index.d.ts +1 -0
- package/src/lib/utils/functions/stringifyURIQuery/stringifyURIQuery.cjs +13 -0
- package/src/lib/utils/functions/stringifyURIQuery/stringifyURIQuery.d.ts +1 -0
- package/src/lib/utils/functions/stringifyURIQuery/stringifyURIQuery.js +9 -0
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +10 -5
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +10 -5
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +6 -2
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +6 -2
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +13 -4
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.d.ts +1 -19
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +13 -4
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +22 -28
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +1 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +23 -29
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +7 -6
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +7 -6
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +10 -1
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +10 -1
- package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.cjs +15 -1
- package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.js +15 -1
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.cjs +6 -2
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.d.ts +2 -1
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.js +6 -2
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +132 -24
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.d.ts +5 -1
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +134 -26
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +13 -3
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +13 -3
- package/src/lib/utils/hooks/useWallets/useWallets.cjs +16 -25
- package/src/lib/utils/hooks/useWallets/useWallets.d.ts +3 -2
- package/src/lib/utils/hooks/useWallets/useWallets.js +17 -26
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +3 -3
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +3 -3
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +1 -1
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +1 -1
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +1 -1
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +1 -1
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +3 -2
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +3 -2
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +3 -2
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +3 -2
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.cjs +4 -10
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.js +4 -10
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +1 -0
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.js +1 -0
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +1 -1
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +1 -1
- package/src/lib/views/WalletList/data.cjs +2 -14
- package/src/lib/views/WalletList/data.d.ts +4 -2
- package/src/lib/views/WalletList/data.js +2 -13
- package/src/lib/views/viewToComponentMap.cjs +1 -0
- package/src/lib/views/viewToComponentMap.js +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/views/EditProfileView/EditProfileView.cjs +3 -3
- package/src/lib/widgets/DynamicBridgeWidget/views/EditProfileView/EditProfileView.js +3 -3
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +7 -10
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +8 -11
- package/src/lib/widgets/DynamicWidget/hooks/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs +4 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js +4 -1
- package/src/lib/widgets/DynamicWidget/hooks/useViewController/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/hooks/useViewController/useViewController.cjs +17 -0
- package/src/lib/widgets/DynamicWidget/hooks/useViewController/useViewController.d.ts +6 -0
- package/src/lib/widgets/DynamicWidget/hooks/useViewController/useViewController.js +13 -0
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +3 -3
- package/src/lib/widgets/DynamicWidget/views/SendBalanceWidgetView/SendBalanceWidgetView.cjs +2 -3
- package/src/lib/widgets/DynamicWidget/views/SendBalanceWidgetView/SendBalanceWidgetView.js +2 -3
- package/src/lib/widgets/OAuthIFrameContainer/OAuthIFrameContainer.cjs +13 -0
- package/src/lib/widgets/OAuthIFrameContainer/OAuthIFrameContainer.d.ts +2 -0
- package/src/lib/widgets/OAuthIFrameContainer/OAuthIFrameContainer.js +9 -0
- package/src/lib/widgets/OAuthIFrameContainer/index.d.ts +1 -0
- package/src/lib/widgets/index.d.ts +1 -0
|
@@ -19,6 +19,7 @@ require('viem');
|
|
|
19
19
|
require('../../../../shared/consts/index.cjs');
|
|
20
20
|
require('@dynamic-labs/multi-wallet');
|
|
21
21
|
var isMagicConnector = require('../../../../utils/functions/isMagicConnector/isMagicConnector.cjs');
|
|
22
|
+
var sendTransactionWithAutoNonce = require('../../../../utils/functions/sendTransactionWithAutoNonce/sendTransactionWithAutoNonce.cjs');
|
|
22
23
|
require('@dynamic-labs/rpc-providers');
|
|
23
24
|
require('../../../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs');
|
|
24
25
|
var useInternalDynamicContext = require('../../../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
@@ -55,19 +56,12 @@ const TransactionStage = (_a) => {
|
|
|
55
56
|
provider,
|
|
56
57
|
transaction,
|
|
57
58
|
});
|
|
58
|
-
return (jsxRuntime.jsx(TransactionConfirmationView.TransactionConfirmationView, Object.assign({ provider: provider, transaction: transactionWithGasPrice, mutation: () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
+
return (jsxRuntime.jsx(TransactionConfirmationView.TransactionConfirmationView, Object.assign({ provider: provider, transaction: transactionWithGasPrice, mutation: () => sendTransactionWithAutoNonce.sendTransactionWithAutoNonce(walletConnector, transactionWithGasPrice, (transaction) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
59
60
|
walletUiUtils.disabledConfirmationOnce();
|
|
60
61
|
const signer = yield walletConnector.getSigner();
|
|
61
|
-
const sentTransaction = yield signer.sendTransaction({
|
|
62
|
-
account: transactionWithGasPrice.from,
|
|
63
|
-
chain: null,
|
|
64
|
-
gasPrice: transactionWithGasPrice.gasPrice,
|
|
65
|
-
to: transactionWithGasPrice.to,
|
|
66
|
-
type: 'eip2930',
|
|
67
|
-
value: transactionWithGasPrice.value,
|
|
68
|
-
});
|
|
62
|
+
const sentTransaction = yield signer.sendTransaction(Object.assign(Object.assign({}, transaction), { account: transaction.from, chain: null }));
|
|
69
63
|
return sentTransaction;
|
|
70
|
-
}) }, rest)));
|
|
64
|
+
})) }, rest)));
|
|
71
65
|
};
|
|
72
66
|
|
|
73
67
|
exports.TransactionStage = TransactionStage;
|
|
@@ -15,6 +15,7 @@ import 'viem';
|
|
|
15
15
|
import '../../../../shared/consts/index.js';
|
|
16
16
|
import '@dynamic-labs/multi-wallet';
|
|
17
17
|
import { isMagicConnector } from '../../../../utils/functions/isMagicConnector/isMagicConnector.js';
|
|
18
|
+
import { sendTransactionWithAutoNonce } from '../../../../utils/functions/sendTransactionWithAutoNonce/sendTransactionWithAutoNonce.js';
|
|
18
19
|
import '@dynamic-labs/rpc-providers';
|
|
19
20
|
import '../../../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.js';
|
|
20
21
|
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
@@ -51,19 +52,12 @@ const TransactionStage = (_a) => {
|
|
|
51
52
|
provider,
|
|
52
53
|
transaction,
|
|
53
54
|
});
|
|
54
|
-
return (jsx(TransactionConfirmationView, Object.assign({ provider: provider, transaction: transactionWithGasPrice, mutation: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
55
|
+
return (jsx(TransactionConfirmationView, Object.assign({ provider: provider, transaction: transactionWithGasPrice, mutation: () => sendTransactionWithAutoNonce(walletConnector, transactionWithGasPrice, (transaction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
55
56
|
walletUiUtils.disabledConfirmationOnce();
|
|
56
57
|
const signer = yield walletConnector.getSigner();
|
|
57
|
-
const sentTransaction = yield signer.sendTransaction({
|
|
58
|
-
account: transactionWithGasPrice.from,
|
|
59
|
-
chain: null,
|
|
60
|
-
gasPrice: transactionWithGasPrice.gasPrice,
|
|
61
|
-
to: transactionWithGasPrice.to,
|
|
62
|
-
type: 'eip2930',
|
|
63
|
-
value: transactionWithGasPrice.value,
|
|
64
|
-
});
|
|
58
|
+
const sentTransaction = yield signer.sendTransaction(Object.assign(Object.assign({}, transaction), { account: transaction.from, chain: null }));
|
|
65
59
|
return sentTransaction;
|
|
66
|
-
}) }, rest)));
|
|
60
|
+
})) }, rest)));
|
|
67
61
|
};
|
|
68
62
|
|
|
69
63
|
export { TransactionStage };
|
|
@@ -13,6 +13,7 @@ require('@dynamic-labs/wallet-book');
|
|
|
13
13
|
var getWalletListItemLabel = require('../../../../shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.cjs');
|
|
14
14
|
require('viem');
|
|
15
15
|
require('../../../../shared/utils/classes/storage/localStorage.cjs');
|
|
16
|
+
require('@dynamic-labs/utils');
|
|
16
17
|
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
17
18
|
var stroke = require('../../../../shared/assets/stroke.cjs');
|
|
18
19
|
require('../../../../shared/consts/index.cjs');
|
|
@@ -9,6 +9,7 @@ import '@dynamic-labs/wallet-book';
|
|
|
9
9
|
import { getWalletListItemLabel } from '../../../../shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.js';
|
|
10
10
|
import 'viem';
|
|
11
11
|
import '../../../../shared/utils/classes/storage/localStorage.js';
|
|
12
|
+
import '@dynamic-labs/utils';
|
|
12
13
|
import '../../../../context/ViewContext/ViewContext.js';
|
|
13
14
|
import { ReactComponent as SvgStroke } from '../../../../shared/assets/stroke.js';
|
|
14
15
|
import '../../../../shared/consts/index.js';
|
|
@@ -16,11 +16,11 @@ require('@dynamic-labs/wallet-connector-core');
|
|
|
16
16
|
var getWalletListItemLabel = require('../../../shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.cjs');
|
|
17
17
|
require('viem');
|
|
18
18
|
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
19
|
+
require('@dynamic-labs/utils');
|
|
19
20
|
require('../../../shared/consts/index.cjs');
|
|
20
21
|
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
21
22
|
require('../../../utils/constants/colors.cjs');
|
|
22
23
|
require('@dynamic-labs/multi-wallet');
|
|
23
|
-
require('@dynamic-labs/utils');
|
|
24
24
|
var pixelToRem = require('../../../utils/functions/pixelToRem/pixelToRem.cjs');
|
|
25
25
|
require('../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
26
26
|
require('../../../context/ThemeContext/ThemeContext.cjs');
|
|
@@ -12,11 +12,11 @@ import '@dynamic-labs/wallet-connector-core';
|
|
|
12
12
|
import { getWalletListItemLabel } from '../../../shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.js';
|
|
13
13
|
import 'viem';
|
|
14
14
|
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
15
|
+
import '@dynamic-labs/utils';
|
|
15
16
|
import '../../../shared/consts/index.js';
|
|
16
17
|
import '../../../context/DynamicContext/DynamicContext.js';
|
|
17
18
|
import '../../../utils/constants/colors.js';
|
|
18
19
|
import '@dynamic-labs/multi-wallet';
|
|
19
|
-
import '@dynamic-labs/utils';
|
|
20
20
|
import { pixelToRem } from '../../../utils/functions/pixelToRem/pixelToRem.js';
|
|
21
21
|
import '../../../components/ShadowDOM/ShadowDOM.js';
|
|
22
22
|
import '../../../context/ThemeContext/ThemeContext.js';
|
|
@@ -22,7 +22,7 @@ const getEnabledChains = (chains) => chains
|
|
|
22
22
|
.filter(({ enabled }) => enabled)
|
|
23
23
|
.map(({ name }) => { var _a; return (_a = walletConnectorCore.getChainInfo(name)) === null || _a === void 0 ? void 0 : _a.symbol; })
|
|
24
24
|
.filter((chain) => Boolean(chain));
|
|
25
|
-
const
|
|
25
|
+
const getWallets = (props) => {
|
|
26
26
|
var _a, _b, _c, _d;
|
|
27
27
|
return multiWallet.getEnabledWallets({
|
|
28
28
|
enabledChains: getEnabledChains(props.settings.chains),
|
|
@@ -31,20 +31,8 @@ const createWallets = (props) => {
|
|
|
31
31
|
((_b = props.settings.sdk.walletConnect) === null || _b === void 0 ? void 0 : _b.projectId)
|
|
32
32
|
? (_c = props.settings.sdk.walletConnect) === null || _c === void 0 ? void 0 : _c.v2Enabled
|
|
33
33
|
: false, walletConnectProjectId: (_d = props.settings.sdk.walletConnect) === null || _d === void 0 ? void 0 : _d.projectId }),
|
|
34
|
-
installed: props.installed,
|
|
35
34
|
}).map((wallet) => createWallet.createWallet(props.getSupportedWalletOpts.walletBook, wallet));
|
|
36
35
|
};
|
|
37
|
-
const getInstalledWallets = (settings, getSupportedWalletOpts) => createWallets({
|
|
38
|
-
getSupportedWalletOpts,
|
|
39
|
-
installed: true,
|
|
40
|
-
settings,
|
|
41
|
-
});
|
|
42
|
-
const getNotInstalledWallets = (settings, getSupportedWalletOpts) => createWallets({
|
|
43
|
-
getSupportedWalletOpts,
|
|
44
|
-
installed: false,
|
|
45
|
-
settings,
|
|
46
|
-
});
|
|
47
36
|
|
|
48
37
|
exports.getEnabledChains = getEnabledChains;
|
|
49
|
-
exports.
|
|
50
|
-
exports.getNotInstalledWallets = getNotInstalledWallets;
|
|
38
|
+
exports.getWallets = getWallets;
|
|
@@ -6,6 +6,8 @@ interface IChain {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const getEnabledChains: (chains: IChain[]) => ("ETH" | "FLOW" | "SOL" | "EVM" | "ALGO" | "STARK" | "ATOM" | "COSMOS")[];
|
|
8
8
|
type BaseGetSupportedWalletOpts = Omit<GetSupportedWalletsOpts, 'isWalletConnectV2Enabled' | 'walletConnectProjectId' | 'chainRpcProviders'>;
|
|
9
|
-
export declare const
|
|
10
|
-
|
|
9
|
+
export declare const getWallets: (props: {
|
|
10
|
+
getSupportedWalletOpts: BaseGetSupportedWalletOpts;
|
|
11
|
+
settings: ProjectSettings;
|
|
12
|
+
}) => import("../../shared").WalletOption[];
|
|
11
13
|
export {};
|
|
@@ -18,7 +18,7 @@ const getEnabledChains = (chains) => chains
|
|
|
18
18
|
.filter(({ enabled }) => enabled)
|
|
19
19
|
.map(({ name }) => { var _a; return (_a = getChainInfo(name)) === null || _a === void 0 ? void 0 : _a.symbol; })
|
|
20
20
|
.filter((chain) => Boolean(chain));
|
|
21
|
-
const
|
|
21
|
+
const getWallets = (props) => {
|
|
22
22
|
var _a, _b, _c, _d;
|
|
23
23
|
return getEnabledWallets({
|
|
24
24
|
enabledChains: getEnabledChains(props.settings.chains),
|
|
@@ -27,18 +27,7 @@ const createWallets = (props) => {
|
|
|
27
27
|
((_b = props.settings.sdk.walletConnect) === null || _b === void 0 ? void 0 : _b.projectId)
|
|
28
28
|
? (_c = props.settings.sdk.walletConnect) === null || _c === void 0 ? void 0 : _c.v2Enabled
|
|
29
29
|
: false, walletConnectProjectId: (_d = props.settings.sdk.walletConnect) === null || _d === void 0 ? void 0 : _d.projectId }),
|
|
30
|
-
installed: props.installed,
|
|
31
30
|
}).map((wallet) => createWallet(props.getSupportedWalletOpts.walletBook, wallet));
|
|
32
31
|
};
|
|
33
|
-
const getInstalledWallets = (settings, getSupportedWalletOpts) => createWallets({
|
|
34
|
-
getSupportedWalletOpts,
|
|
35
|
-
installed: true,
|
|
36
|
-
settings,
|
|
37
|
-
});
|
|
38
|
-
const getNotInstalledWallets = (settings, getSupportedWalletOpts) => createWallets({
|
|
39
|
-
getSupportedWalletOpts,
|
|
40
|
-
installed: false,
|
|
41
|
-
settings,
|
|
42
|
-
});
|
|
43
32
|
|
|
44
|
-
export { getEnabledChains,
|
|
33
|
+
export { getEnabledChains, getWallets };
|
|
@@ -46,6 +46,7 @@ const viewToComponentMap = {
|
|
|
46
46
|
'login-with-email-or-wallet-full-wallet-list': jsxRuntime.jsx(WalletList.WalletList, {}),
|
|
47
47
|
'login-with-email-verification': jsxRuntime.jsx(EmailVerification.EmailVerification, {}),
|
|
48
48
|
'merge-user-accounts': jsxRuntime.jsx(MergeUserAccountsView.MergeUserAccountsView, {}),
|
|
49
|
+
'multi-wallet-wallet-list': jsxRuntime.jsx(WalletList.WalletList, {}),
|
|
49
50
|
'network-not-supported': jsxRuntime.jsx(NetworkNotSupported.NetworkNotSupported, {}),
|
|
50
51
|
'network-not-supported-manual': jsxRuntime.jsx(NetworkNotSupportedSwitchManual.NetworkNotSupportedSwitchManual, {}),
|
|
51
52
|
'no-access': jsxRuntime.jsx(NoAccess.NoAccess, {}),
|
|
@@ -42,6 +42,7 @@ const viewToComponentMap = {
|
|
|
42
42
|
'login-with-email-or-wallet-full-wallet-list': jsx(WalletList, {}),
|
|
43
43
|
'login-with-email-verification': jsx(EmailVerification, {}),
|
|
44
44
|
'merge-user-accounts': jsx(MergeUserAccountsView, {}),
|
|
45
|
+
'multi-wallet-wallet-list': jsx(WalletList, {}),
|
|
45
46
|
'network-not-supported': jsx(NetworkNotSupported, {}),
|
|
46
47
|
'network-not-supported-manual': jsx(NetworkNotSupportedSwitchManual, {}),
|
|
47
48
|
'no-access': jsx(NoAccess, {}),
|
|
@@ -14,7 +14,7 @@ var UserProfileForm = require('../../../../components/UserProfileForm/UserProfil
|
|
|
14
14
|
const EditProfileView = () => {
|
|
15
15
|
const { setView } = ViewContext.useViewContext();
|
|
16
16
|
const { goToProfileView } = DynamicBridgeWidgetContext.useDynamicBridgeWidgetContext();
|
|
17
|
-
const {
|
|
17
|
+
const { internalSetShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
18
18
|
const { updateUser } = useUserUpdateRequest.useUserUpdateRequestInternal({
|
|
19
19
|
validationSchemaStripUnknown: true,
|
|
20
20
|
});
|
|
@@ -22,10 +22,10 @@ const EditProfileView = () => {
|
|
|
22
22
|
const { isEmailVerificationRequired } = yield updateUser(formValues);
|
|
23
23
|
goToProfileView();
|
|
24
24
|
if (isEmailVerificationRequired) {
|
|
25
|
-
|
|
25
|
+
internalSetShowAuthFlow(true);
|
|
26
26
|
setView('verify-email');
|
|
27
27
|
}
|
|
28
|
-
}), [goToProfileView,
|
|
28
|
+
}), [goToProfileView, internalSetShowAuthFlow, setView, updateUser]);
|
|
29
29
|
return (jsxRuntime.jsx(UserProfileForm.UserProfileForm, { onEditProfileSubmit: onEditProfileFormSubmit, onEditProfileCancel: goToProfileView }));
|
|
30
30
|
};
|
|
31
31
|
|
|
@@ -10,7 +10,7 @@ import { UserProfileForm } from '../../../../components/UserProfileForm/UserProf
|
|
|
10
10
|
const EditProfileView = () => {
|
|
11
11
|
const { setView } = useViewContext();
|
|
12
12
|
const { goToProfileView } = useDynamicBridgeWidgetContext();
|
|
13
|
-
const {
|
|
13
|
+
const { internalSetShowAuthFlow } = useInternalDynamicContext();
|
|
14
14
|
const { updateUser } = useUserUpdateRequestInternal({
|
|
15
15
|
validationSchemaStripUnknown: true,
|
|
16
16
|
});
|
|
@@ -18,10 +18,10 @@ const EditProfileView = () => {
|
|
|
18
18
|
const { isEmailVerificationRequired } = yield updateUser(formValues);
|
|
19
19
|
goToProfileView();
|
|
20
20
|
if (isEmailVerificationRequired) {
|
|
21
|
-
|
|
21
|
+
internalSetShowAuthFlow(true);
|
|
22
22
|
setView('verify-email');
|
|
23
23
|
}
|
|
24
|
-
}), [goToProfileView,
|
|
24
|
+
}), [goToProfileView, internalSetShowAuthFlow, setView, updateUser]);
|
|
25
25
|
return (jsx(UserProfileForm, { onEditProfileSubmit: onEditProfileFormSubmit, onEditProfileCancel: goToProfileView }));
|
|
26
26
|
};
|
|
27
27
|
|
|
@@ -38,6 +38,7 @@ require('formik');
|
|
|
38
38
|
require('yup');
|
|
39
39
|
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
40
40
|
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
41
|
+
var useViewController = require('../hooks/useViewController/useViewController.cjs');
|
|
41
42
|
var useKYCFlag = require('../../../utils/hooks/useKYCFlag/useKYCFlag.cjs');
|
|
42
43
|
var useMultiWalletFlag = require('../../../utils/hooks/useMultiWalletFlag/useMultiWalletFlag.cjs');
|
|
43
44
|
require('../../../context/MockContext/MockContext.cjs');
|
|
@@ -52,8 +53,7 @@ const DynamicWidgetContextProvider = ({ children, }) => {
|
|
|
52
53
|
const { setShowDynamicUserProfile, showDynamicUserProfile } = useInternalDynamicContext.useInternalDynamicContext();
|
|
53
54
|
const isKYCEnabled = useKYCFlag.useKYCFlag();
|
|
54
55
|
const isMultiWalletEnabled = useMultiWalletFlag.useMultiWalletFlag();
|
|
55
|
-
const
|
|
56
|
-
const [dynamicWidgetView, setDynamicWidgetView] = React.useState(initialView);
|
|
56
|
+
const { view: dynamicWidgetView, setView: setDynamicWidgetView, goToInitialView: goToInitialDynamicWidgetView, } = useViewController.useViewController(isKYCEnabled && !isMultiWalletEnabled ? 'profile' : 'wallets');
|
|
57
57
|
const goToProfileView = React.useCallback(() => {
|
|
58
58
|
if (isKYCEnabled)
|
|
59
59
|
return setDynamicWidgetView('profile');
|
|
@@ -64,18 +64,14 @@ const DynamicWidgetContextProvider = ({ children, }) => {
|
|
|
64
64
|
if (!showDynamicUserProfile) {
|
|
65
65
|
// wait for exit animation to finish
|
|
66
66
|
setTimeout(() => {
|
|
67
|
-
|
|
67
|
+
goToInitialDynamicWidgetView();
|
|
68
68
|
}, 200);
|
|
69
69
|
}
|
|
70
|
-
}, [
|
|
71
|
-
// set correct initial view once isKYCEnabled and isMultiWalletEnabled values are correctly set
|
|
72
|
-
// *isKYCEnabled is always false when the context initializes, so the initial view is set to index
|
|
73
|
-
React.useEffect(() => {
|
|
74
|
-
setDynamicWidgetView(initialView);
|
|
75
|
-
}, [initialView, isKYCEnabled, isMultiWalletEnabled]);
|
|
70
|
+
}, [goToInitialDynamicWidgetView, showDynamicUserProfile]);
|
|
76
71
|
const value = React.useMemo(() => ({
|
|
77
72
|
availableWalletsContainerRef,
|
|
78
73
|
dynamicWidgetView,
|
|
74
|
+
goToInitialDynamicWidgetView,
|
|
79
75
|
goToProfileView,
|
|
80
76
|
inlineControlsRef,
|
|
81
77
|
isOpen: showDynamicUserProfile,
|
|
@@ -84,8 +80,9 @@ const DynamicWidgetContextProvider = ({ children, }) => {
|
|
|
84
80
|
widgetRef,
|
|
85
81
|
}), [
|
|
86
82
|
dynamicWidgetView,
|
|
87
|
-
goToProfileView,
|
|
88
83
|
setShowDynamicUserProfile,
|
|
84
|
+
goToInitialDynamicWidgetView,
|
|
85
|
+
goToProfileView,
|
|
89
86
|
showDynamicUserProfile,
|
|
90
87
|
]);
|
|
91
88
|
return (jsxRuntime.jsx(DynamicWidgetContext.Provider, { value: value, children: children }));
|
|
@@ -3,6 +3,7 @@ export interface WidgetContextProps {
|
|
|
3
3
|
availableWalletsContainerRef: RefObject<HTMLDivElement>;
|
|
4
4
|
dynamicWidgetView: DynamicWidgetViews;
|
|
5
5
|
goToProfileView: () => void;
|
|
6
|
+
goToInitialDynamicWidgetView: () => void;
|
|
6
7
|
inlineControlsRef: RefObject<HTMLDivElement>;
|
|
7
8
|
isOpen: boolean;
|
|
8
9
|
setDynamicWidgetView: Dispatch<SetStateAction<DynamicWidgetViews>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { createContext, useRef,
|
|
2
|
+
import { createContext, useRef, useCallback, useEffect, useMemo, useContext } from 'react';
|
|
3
3
|
import '@dynamic-labs/utils';
|
|
4
4
|
import '@dynamic-labs/sdk-api';
|
|
5
5
|
import '../../../config/ApiEndpoint.js';
|
|
@@ -34,6 +34,7 @@ import 'formik';
|
|
|
34
34
|
import 'yup';
|
|
35
35
|
import '../../../components/InlineWidget/InlineWidget.js';
|
|
36
36
|
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
37
|
+
import { useViewController } from '../hooks/useViewController/useViewController.js';
|
|
37
38
|
import { useKYCFlag } from '../../../utils/hooks/useKYCFlag/useKYCFlag.js';
|
|
38
39
|
import { useMultiWalletFlag } from '../../../utils/hooks/useMultiWalletFlag/useMultiWalletFlag.js';
|
|
39
40
|
import '../../../context/MockContext/MockContext.js';
|
|
@@ -48,8 +49,7 @@ const DynamicWidgetContextProvider = ({ children, }) => {
|
|
|
48
49
|
const { setShowDynamicUserProfile, showDynamicUserProfile } = useInternalDynamicContext();
|
|
49
50
|
const isKYCEnabled = useKYCFlag();
|
|
50
51
|
const isMultiWalletEnabled = useMultiWalletFlag();
|
|
51
|
-
const
|
|
52
|
-
const [dynamicWidgetView, setDynamicWidgetView] = useState(initialView);
|
|
52
|
+
const { view: dynamicWidgetView, setView: setDynamicWidgetView, goToInitialView: goToInitialDynamicWidgetView, } = useViewController(isKYCEnabled && !isMultiWalletEnabled ? 'profile' : 'wallets');
|
|
53
53
|
const goToProfileView = useCallback(() => {
|
|
54
54
|
if (isKYCEnabled)
|
|
55
55
|
return setDynamicWidgetView('profile');
|
|
@@ -60,18 +60,14 @@ const DynamicWidgetContextProvider = ({ children, }) => {
|
|
|
60
60
|
if (!showDynamicUserProfile) {
|
|
61
61
|
// wait for exit animation to finish
|
|
62
62
|
setTimeout(() => {
|
|
63
|
-
|
|
63
|
+
goToInitialDynamicWidgetView();
|
|
64
64
|
}, 200);
|
|
65
65
|
}
|
|
66
|
-
}, [
|
|
67
|
-
// set correct initial view once isKYCEnabled and isMultiWalletEnabled values are correctly set
|
|
68
|
-
// *isKYCEnabled is always false when the context initializes, so the initial view is set to index
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
setDynamicWidgetView(initialView);
|
|
71
|
-
}, [initialView, isKYCEnabled, isMultiWalletEnabled]);
|
|
66
|
+
}, [goToInitialDynamicWidgetView, showDynamicUserProfile]);
|
|
72
67
|
const value = useMemo(() => ({
|
|
73
68
|
availableWalletsContainerRef,
|
|
74
69
|
dynamicWidgetView,
|
|
70
|
+
goToInitialDynamicWidgetView,
|
|
75
71
|
goToProfileView,
|
|
76
72
|
inlineControlsRef,
|
|
77
73
|
isOpen: showDynamicUserProfile,
|
|
@@ -80,8 +76,9 @@ const DynamicWidgetContextProvider = ({ children, }) => {
|
|
|
80
76
|
widgetRef,
|
|
81
77
|
}), [
|
|
82
78
|
dynamicWidgetView,
|
|
83
|
-
goToProfileView,
|
|
84
79
|
setShowDynamicUserProfile,
|
|
80
|
+
goToInitialDynamicWidgetView,
|
|
81
|
+
goToProfileView,
|
|
85
82
|
showDynamicUserProfile,
|
|
86
83
|
]);
|
|
87
84
|
return (jsx(DynamicWidgetContext.Provider, { value: value, children: children }));
|
|
@@ -18,7 +18,10 @@ const useFetchCurrency = (connector, network) => {
|
|
|
18
18
|
setCurrency(chainInfo === null || chainInfo === void 0 ? void 0 : chainInfo.symbol);
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const network = connector.connectedChain === 'STARK'
|
|
22
|
+
? 'starknetNetworks'
|
|
23
|
+
: 'evmNetworks';
|
|
24
|
+
const result = (_b = connector[network]) === null || _b === void 0 ? void 0 : _b.find((element) => element.chainId === chainId);
|
|
22
25
|
setCurrency((_d = (_c = result === null || result === void 0 ? void 0 : result.nativeCurrency) === null || _c === void 0 ? void 0 : _c.symbol) !== null && _d !== void 0 ? _d : chainInfo === null || chainInfo === void 0 ? void 0 : chainInfo.symbol);
|
|
23
26
|
return [currency];
|
|
24
27
|
});
|
|
@@ -14,7 +14,10 @@ const useFetchCurrency = (connector, network) => {
|
|
|
14
14
|
setCurrency(chainInfo === null || chainInfo === void 0 ? void 0 : chainInfo.symbol);
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const network = connector.connectedChain === 'STARK'
|
|
18
|
+
? 'starknetNetworks'
|
|
19
|
+
: 'evmNetworks';
|
|
20
|
+
const result = (_b = connector[network]) === null || _b === void 0 ? void 0 : _b.find((element) => element.chainId === chainId);
|
|
18
21
|
setCurrency((_d = (_c = result === null || result === void 0 ? void 0 : result.nativeCurrency) === null || _c === void 0 ? void 0 : _c.symbol) !== null && _d !== void 0 ? _d : chainInfo === null || chainInfo === void 0 ? void 0 : chainInfo.symbol);
|
|
19
22
|
return [currency];
|
|
20
23
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useViewController } from './useViewController';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
const useViewController = (initialView) => {
|
|
8
|
+
const [_view, setView] = React.useState(null);
|
|
9
|
+
const goToInitialView = () => setView(null);
|
|
10
|
+
return {
|
|
11
|
+
goToInitialView,
|
|
12
|
+
setView: setView,
|
|
13
|
+
view: _view || initialView,
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.useViewController = useViewController;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
const useViewController = (initialView) => {
|
|
4
|
+
const [_view, setView] = useState(null);
|
|
5
|
+
const goToInitialView = () => setView(null);
|
|
6
|
+
return {
|
|
7
|
+
goToInitialView,
|
|
8
|
+
setView: setView,
|
|
9
|
+
view: _view || initialView,
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { useViewController };
|
|
@@ -50,7 +50,7 @@ var UserProfileForm = require('../../../../components/UserProfileForm/UserProfil
|
|
|
50
50
|
|
|
51
51
|
const EditProfileView = ({ rootClassName, }) => {
|
|
52
52
|
const { setView } = ViewContext.useViewContext();
|
|
53
|
-
const {
|
|
53
|
+
const { internalSetShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
|
|
54
54
|
const { goToProfileView } = DynamicWidgetContext.useWidgetContext();
|
|
55
55
|
const { updateUser } = useUserUpdateRequest.useUserUpdateRequestInternal({
|
|
56
56
|
validationSchemaStripUnknown: true,
|
|
@@ -59,10 +59,10 @@ const EditProfileView = ({ rootClassName, }) => {
|
|
|
59
59
|
const { isEmailVerificationRequired } = yield updateUser(formValues);
|
|
60
60
|
goToProfileView();
|
|
61
61
|
if (isEmailVerificationRequired) {
|
|
62
|
-
|
|
62
|
+
internalSetShowAuthFlow(true);
|
|
63
63
|
setView('verify-email');
|
|
64
64
|
}
|
|
65
|
-
}), [goToProfileView,
|
|
65
|
+
}), [goToProfileView, internalSetShowAuthFlow, setView, updateUser]);
|
|
66
66
|
const isKYCEnabled = useKYCFlag.useKYCFlag();
|
|
67
67
|
const isMultiWalletEnabled = useMultiWalletFlag.useMultiWalletFlag();
|
|
68
68
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!isMultiWalletEnabled && isKYCEnabled && (jsxRuntime.jsx(Typography.Typography, { weight: 'regular', color: 'secondary', variant: 'body_normal', className: 'dynamic-widget-edit-profile-view__profile-title', children: "My profile" })), jsxRuntime.jsx(UserProfileForm.UserProfileForm, { formClassName: rootClassName, onEditProfileSubmit: onEditProfileFormSubmit, onEditProfileCancel: goToProfileView })] }));
|
|
@@ -46,7 +46,7 @@ import { UserProfileForm } from '../../../../components/UserProfileForm/UserProf
|
|
|
46
46
|
|
|
47
47
|
const EditProfileView = ({ rootClassName, }) => {
|
|
48
48
|
const { setView } = useViewContext();
|
|
49
|
-
const {
|
|
49
|
+
const { internalSetShowAuthFlow } = useInternalDynamicContext();
|
|
50
50
|
const { goToProfileView } = useWidgetContext();
|
|
51
51
|
const { updateUser } = useUserUpdateRequestInternal({
|
|
52
52
|
validationSchemaStripUnknown: true,
|
|
@@ -55,10 +55,10 @@ const EditProfileView = ({ rootClassName, }) => {
|
|
|
55
55
|
const { isEmailVerificationRequired } = yield updateUser(formValues);
|
|
56
56
|
goToProfileView();
|
|
57
57
|
if (isEmailVerificationRequired) {
|
|
58
|
-
|
|
58
|
+
internalSetShowAuthFlow(true);
|
|
59
59
|
setView('verify-email');
|
|
60
60
|
}
|
|
61
|
-
}), [goToProfileView,
|
|
61
|
+
}), [goToProfileView, internalSetShowAuthFlow, setView, updateUser]);
|
|
62
62
|
const isKYCEnabled = useKYCFlag();
|
|
63
63
|
const isMultiWalletEnabled = useMultiWalletFlag();
|
|
64
64
|
return (jsxs(Fragment, { children: [!isMultiWalletEnabled && isKYCEnabled && (jsx(Typography, { weight: 'regular', color: 'secondary', variant: 'body_normal', className: 'dynamic-widget-edit-profile-view__profile-title', children: "My profile" })), jsx(UserProfileForm, { formClassName: rootClassName, onEditProfileSubmit: onEditProfileFormSubmit, onEditProfileCancel: goToProfileView })] }));
|
|
@@ -7,9 +7,8 @@ var DynamicWidgetContext = require('../../context/DynamicWidgetContext.cjs');
|
|
|
7
7
|
var SendBalanceView = require('../../../../views/SendBalanceView/SendBalanceView.cjs');
|
|
8
8
|
|
|
9
9
|
const SendBalanceWidgetView = () => {
|
|
10
|
-
const {
|
|
11
|
-
|
|
12
|
-
return (jsxRuntime.jsx("div", { className: 'send-balance-widget-view', children: jsxRuntime.jsx(SendBalanceView.SendBalanceView, { onClickBack: goToIndex, onDone: goToIndex }) }));
|
|
10
|
+
const { goToInitialDynamicWidgetView } = DynamicWidgetContext.useWidgetContext();
|
|
11
|
+
return (jsxRuntime.jsx("div", { className: 'send-balance-widget-view', children: jsxRuntime.jsx(SendBalanceView.SendBalanceView, { onClickBack: goToInitialDynamicWidgetView, onDone: goToInitialDynamicWidgetView }) }));
|
|
13
12
|
};
|
|
14
13
|
|
|
15
14
|
exports.SendBalanceWidgetView = SendBalanceWidgetView;
|
|
@@ -3,9 +3,8 @@ import { useWidgetContext } from '../../context/DynamicWidgetContext.js';
|
|
|
3
3
|
import { SendBalanceView } from '../../../../views/SendBalanceView/SendBalanceView.js';
|
|
4
4
|
|
|
5
5
|
const SendBalanceWidgetView = () => {
|
|
6
|
-
const {
|
|
7
|
-
|
|
8
|
-
return (jsx("div", { className: 'send-balance-widget-view', children: jsx(SendBalanceView, { onClickBack: goToIndex, onDone: goToIndex }) }));
|
|
6
|
+
const { goToInitialDynamicWidgetView } = useWidgetContext();
|
|
7
|
+
return (jsx("div", { className: 'send-balance-widget-view', children: jsx(SendBalanceView, { onClickBack: goToInitialDynamicWidgetView, onDone: goToInitialDynamicWidgetView }) }));
|
|
9
8
|
};
|
|
10
9
|
|
|
11
10
|
export { SendBalanceWidgetView };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
// we need to use an iframe to be the intermediary in communications between the oauth popup and the sdk
|
|
8
|
+
// because of twitter limitations with accessing the window.opener and BroadcastChannel not working between
|
|
9
|
+
// different origins (our api redirect page and the app where the sdk is running)
|
|
10
|
+
// https://linear.app/dynamic-labs/issue/GVTY-17/[frontend]-fix-twitter-linking
|
|
11
|
+
const OAuthIFrameContainer = () => (jsxRuntime.jsx("div", { id: 'oauth-iframe-container', "data-testid": 'oauth-iframe-container', style: { height: 0, visibility: 'hidden', width: 0 } }));
|
|
12
|
+
|
|
13
|
+
exports.OAuthIFrameContainer = OAuthIFrameContainer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
// we need to use an iframe to be the intermediary in communications between the oauth popup and the sdk
|
|
4
|
+
// because of twitter limitations with accessing the window.opener and BroadcastChannel not working between
|
|
5
|
+
// different origins (our api redirect page and the app where the sdk is running)
|
|
6
|
+
// https://linear.app/dynamic-labs/issue/GVTY-17/[frontend]-fix-twitter-linking
|
|
7
|
+
const OAuthIFrameContainer = () => (jsx("div", { id: 'oauth-iframe-container', "data-testid": 'oauth-iframe-container', style: { height: 0, visibility: 'hidden', width: 0 } }));
|
|
8
|
+
|
|
9
|
+
export { OAuthIFrameContainer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OAuthIFrameContainer } from './OAuthIFrameContainer';
|