@dynamic-labs/sdk-react-core 0.18.100-viem.3 → 0.18.100-viem.31
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 +240 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +10 -10
- package/src/index.cjs +1 -2
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -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 +20 -6
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +11 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +21 -7
- 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 +33 -7
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +33 -7
- 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 +20 -12
- package/src/lib/data/api.d.ts +3 -2
- package/src/lib/data/api.js +20 -12
- 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/getDynamicLayoutData/getDynamicLayoutData.cjs +6 -1
- package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.js +6 -1
- package/src/lib/utils/functions/getProviderByType/getProviderByType.cjs +7 -0
- package/src/lib/utils/functions/getProviderByType/getProviderByType.d.ts +2 -0
- package/src/lib/utils/functions/getProviderByType/getProviderByType.js +3 -0
- package/src/lib/utils/functions/getProviderByType/index.d.ts +1 -0
- package/src/lib/utils/functions/index.d.ts +2 -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/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 -32
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +1 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +23 -33
- 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 +94 -16
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.d.ts +5 -1
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +94 -16
- package/src/lib/utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs +5 -1
- package/src/lib/utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js +5 -1
- 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 +20 -26
- package/src/lib/utils/hooks/useWallets/useWallets.d.ts +3 -2
- package/src/lib/utils/hooks/useWallets/useWallets.js +21 -27
- 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/SendBalanceView.cjs +19 -3
- package/src/lib/views/SendBalanceView/SendBalanceView.js +19 -3
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.cjs +4 -16
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.d.ts +2 -0
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.js +5 -17
- 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/DynamicWidget.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +3 -3
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.cjs +36 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.js +36 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +2 -2
- 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/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
|
@@ -6,35 +6,28 @@ var React = require('react');
|
|
|
6
6
|
var data = require('../../../views/WalletList/data.cjs');
|
|
7
7
|
var verifyMagicIsSetup = require('./utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs');
|
|
8
8
|
|
|
9
|
-
const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, networkConfigurations, walletBook, walletConnectV1Bridge, walletUiUtils, walletConnectorsProp, }) => {
|
|
9
|
+
const useWallets = ({ projectSettings, appLogoUrl, appName, deepLinkPreference, flowNetwork, networkConfigurations, walletBook, walletConnectV1Bridge, walletUiUtils, walletConnectorsProp, }) => {
|
|
10
10
|
const wallets = React.useMemo(() => {
|
|
11
|
-
if (!projectSettings ||
|
|
11
|
+
if (!projectSettings ||
|
|
12
|
+
!Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length ||
|
|
13
|
+
!networkConfigurations)
|
|
12
14
|
return [];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
return data.getWallets({
|
|
16
|
+
getSupportedWalletOpts: {
|
|
17
|
+
appLogoUrl,
|
|
18
|
+
appName,
|
|
19
|
+
customerApiProviders: projectSettings.providers || [],
|
|
20
|
+
deepLinkPreference,
|
|
21
|
+
flowNetwork,
|
|
22
|
+
networkConfigurations,
|
|
23
|
+
skipMemo: true,
|
|
24
|
+
walletBook,
|
|
25
|
+
walletConnectV1Bridge,
|
|
26
|
+
walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
|
|
27
|
+
walletUiUtils,
|
|
28
|
+
},
|
|
29
|
+
settings: projectSettings,
|
|
24
30
|
});
|
|
25
|
-
const notInstalledWallets = data.getNotInstalledWallets(projectSettings, {
|
|
26
|
-
appLogoUrl,
|
|
27
|
-
appName,
|
|
28
|
-
customerApiProviders: projectSettings.providers || [],
|
|
29
|
-
flowNetwork,
|
|
30
|
-
networkConfigurations,
|
|
31
|
-
skipMemo: true,
|
|
32
|
-
walletBook,
|
|
33
|
-
walletConnectV1Bridge,
|
|
34
|
-
walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
|
|
35
|
-
walletUiUtils,
|
|
36
|
-
});
|
|
37
|
-
return [...installedWallets, ...notInstalledWallets];
|
|
38
31
|
// Cannot include walletUiUtils in the dependency array because it will cause an infinite loop
|
|
39
32
|
}, [
|
|
40
33
|
appLogoUrl,
|
|
@@ -45,6 +38,7 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, network
|
|
|
45
38
|
walletConnectV1Bridge,
|
|
46
39
|
flowNetwork,
|
|
47
40
|
Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length,
|
|
41
|
+
networkConfigurations,
|
|
48
42
|
]);
|
|
49
43
|
React.useEffect(() => {
|
|
50
44
|
if (!projectSettings || wallets.length === 0)
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ProjectSettings } from '@dynamic-labs/sdk-api';
|
|
2
2
|
import { NetworkConfigurationMap, WalletUiUtils } from '@dynamic-labs/types';
|
|
3
|
-
import { WalletConnector, WalletConnectorsMethod } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
+
import { DeepLinkVariant, WalletConnector, WalletConnectorsMethod } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import { WalletBookSchema } from '@dynamic-labs/wallet-book';
|
|
5
5
|
type Props = {
|
|
6
6
|
appLogoUrl?: string;
|
|
7
7
|
appName?: string;
|
|
8
|
+
deepLinkPreference?: DeepLinkVariant;
|
|
8
9
|
flowNetwork?: 'mainnet' | 'testnet';
|
|
9
10
|
networkConfigurations: NetworkConfigurationMap | undefined;
|
|
10
11
|
projectSettings: ProjectSettings | undefined;
|
|
@@ -13,7 +14,7 @@ type Props = {
|
|
|
13
14
|
walletConnectorsProp?: WalletConnectorsMethod[];
|
|
14
15
|
walletUiUtils: WalletUiUtils<WalletConnector>;
|
|
15
16
|
};
|
|
16
|
-
export declare const useWallets: ({ projectSettings, appLogoUrl, appName, flowNetwork, networkConfigurations, walletBook, walletConnectV1Bridge, walletUiUtils, walletConnectorsProp, }: Props) => {
|
|
17
|
+
export declare const useWallets: ({ projectSettings, appLogoUrl, appName, deepLinkPreference, flowNetwork, networkConfigurations, walletBook, walletConnectV1Bridge, walletUiUtils, walletConnectorsProp, }: Props) => {
|
|
17
18
|
wallets: import("../../../shared").WalletOption[];
|
|
18
19
|
};
|
|
19
20
|
export {};
|
|
@@ -1,36 +1,29 @@
|
|
|
1
1
|
import { useMemo, useEffect } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { getWallets } from '../../../views/WalletList/data.js';
|
|
3
3
|
import { verifyMagicIsSetup } from './utils/verifyMagicIsSetup/verifyMagicIsSetup.js';
|
|
4
4
|
|
|
5
|
-
const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, networkConfigurations, walletBook, walletConnectV1Bridge, walletUiUtils, walletConnectorsProp, }) => {
|
|
5
|
+
const useWallets = ({ projectSettings, appLogoUrl, appName, deepLinkPreference, flowNetwork, networkConfigurations, walletBook, walletConnectV1Bridge, walletUiUtils, walletConnectorsProp, }) => {
|
|
6
6
|
const wallets = useMemo(() => {
|
|
7
|
-
if (!projectSettings ||
|
|
7
|
+
if (!projectSettings ||
|
|
8
|
+
!Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length ||
|
|
9
|
+
!networkConfigurations)
|
|
8
10
|
return [];
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
return getWallets({
|
|
12
|
+
getSupportedWalletOpts: {
|
|
13
|
+
appLogoUrl,
|
|
14
|
+
appName,
|
|
15
|
+
customerApiProviders: projectSettings.providers || [],
|
|
16
|
+
deepLinkPreference,
|
|
17
|
+
flowNetwork,
|
|
18
|
+
networkConfigurations,
|
|
19
|
+
skipMemo: true,
|
|
20
|
+
walletBook,
|
|
21
|
+
walletConnectV1Bridge,
|
|
22
|
+
walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
|
|
23
|
+
walletUiUtils,
|
|
24
|
+
},
|
|
25
|
+
settings: projectSettings,
|
|
20
26
|
});
|
|
21
|
-
const notInstalledWallets = getNotInstalledWallets(projectSettings, {
|
|
22
|
-
appLogoUrl,
|
|
23
|
-
appName,
|
|
24
|
-
customerApiProviders: projectSettings.providers || [],
|
|
25
|
-
flowNetwork,
|
|
26
|
-
networkConfigurations,
|
|
27
|
-
skipMemo: true,
|
|
28
|
-
walletBook,
|
|
29
|
-
walletConnectV1Bridge,
|
|
30
|
-
walletConnectorsProp: walletConnectorsProp !== null && walletConnectorsProp !== void 0 ? walletConnectorsProp : [],
|
|
31
|
-
walletUiUtils,
|
|
32
|
-
});
|
|
33
|
-
return [...installedWallets, ...notInstalledWallets];
|
|
34
27
|
// Cannot include walletUiUtils in the dependency array because it will cause an infinite loop
|
|
35
28
|
}, [
|
|
36
29
|
appLogoUrl,
|
|
@@ -41,6 +34,7 @@ const useWallets = ({ projectSettings, appLogoUrl, appName, flowNetwork, network
|
|
|
41
34
|
walletConnectV1Bridge,
|
|
42
35
|
flowNetwork,
|
|
43
36
|
Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length,
|
|
37
|
+
networkConfigurations,
|
|
44
38
|
]);
|
|
45
39
|
useEffect(() => {
|
|
46
40
|
if (!projectSettings || wallets.length === 0)
|
|
@@ -48,7 +48,7 @@ var index = require('../UserDataFields/index.cjs');
|
|
|
48
48
|
var useUserDataForm = require('../../../utils/hooks/useUserDataForm/useUserDataForm.cjs');
|
|
49
49
|
|
|
50
50
|
const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
|
|
51
|
-
const { policiesConsentInnerComponent, onboardingOnlyJwt,
|
|
51
|
+
const { policiesConsentInnerComponent, onboardingOnlyJwt, internalSetShowAuthFlow, setCallback, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
52
52
|
const { setView, view } = ViewContext.useViewContext();
|
|
53
53
|
const decodedJwt = decodeJwt.decodeJwt(onboardingOnlyJwt);
|
|
54
54
|
const { updateUser } = useUserUpdateRequest.useUserUpdateRequestInternal({
|
|
@@ -67,9 +67,9 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
|
|
|
67
67
|
setView(view);
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
internalSetShowAuthFlow(false);
|
|
71
71
|
setCallback('authSuccess');
|
|
72
|
-
}), [setCallback,
|
|
72
|
+
}), [setCallback, internalSetShowAuthFlow, setView, updateUser]);
|
|
73
73
|
const { fetch: loading, formikInitialValues, formikValidationSchema, enforcePolicies, onFormSubmit, } = useUserDataForm.useUserDataForm({
|
|
74
74
|
fields: (decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.missingFields) || [],
|
|
75
75
|
onSubmit,
|
|
@@ -44,7 +44,7 @@ import { UserDataFields } from '../UserDataFields/index.js';
|
|
|
44
44
|
import { useUserDataForm } from '../../../utils/hooks/useUserDataForm/useUserDataForm.js';
|
|
45
45
|
|
|
46
46
|
const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
|
|
47
|
-
const { policiesConsentInnerComponent, onboardingOnlyJwt,
|
|
47
|
+
const { policiesConsentInnerComponent, onboardingOnlyJwt, internalSetShowAuthFlow, setCallback, } = useInternalDynamicContext();
|
|
48
48
|
const { setView, view } = useViewContext();
|
|
49
49
|
const decodedJwt = decodeJwt(onboardingOnlyJwt);
|
|
50
50
|
const { updateUser } = useUserUpdateRequestInternal({
|
|
@@ -63,9 +63,9 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
|
|
|
63
63
|
setView(view);
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
internalSetShowAuthFlow(false);
|
|
67
67
|
setCallback('authSuccess');
|
|
68
|
-
}), [setCallback,
|
|
68
|
+
}), [setCallback, internalSetShowAuthFlow, setView, updateUser]);
|
|
69
69
|
const { fetch: loading, formikInitialValues, formikValidationSchema, enforcePolicies, onFormSubmit, } = useUserDataForm({
|
|
70
70
|
fields: (decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.missingFields) || [],
|
|
71
71
|
onSubmit,
|
|
@@ -65,7 +65,7 @@ const EmailWalletOTPVerificationView = () => {
|
|
|
65
65
|
const { data: isValid, isLoading, mutate: onSubmit, } = useMutation.useMutation((otp) => emailWalletConnector.verifyOneTimePassword(otp), {
|
|
66
66
|
onFailure: (error) => setError(error),
|
|
67
67
|
});
|
|
68
|
-
return (jsxRuntime.jsx(OTPVerificationView.OTPVerificationView, { email: email, error: error, onClickBack: handleBackClick, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid === true, onPinChange: () => setError(undefined), onClickClose: handleOnClickClose, onClickEditEmail: handleBackClick, displayPoweredByDynamic: true }));
|
|
68
|
+
return (jsxRuntime.jsx(OTPVerificationView.OTPVerificationView, { email: email, error: error, onClickBack: handleBackClick, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid === true, onPinChange: () => setError(undefined), onClickClose: handleOnClickClose, onClickEditEmail: handleBackClick, displayPoweredByDynamic: true, successBannerText: 'Sign in to access your email based wallet' }));
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
exports.EmailWalletOTPVerificationView = EmailWalletOTPVerificationView;
|
|
@@ -61,7 +61,7 @@ const EmailWalletOTPVerificationView = () => {
|
|
|
61
61
|
const { data: isValid, isLoading, mutate: onSubmit, } = useMutation((otp) => emailWalletConnector.verifyOneTimePassword(otp), {
|
|
62
62
|
onFailure: (error) => setError(error),
|
|
63
63
|
});
|
|
64
|
-
return (jsx(OTPVerificationView, { email: email, error: error, onClickBack: handleBackClick, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid === true, onPinChange: () => setError(undefined), onClickClose: handleOnClickClose, onClickEditEmail: handleBackClick, displayPoweredByDynamic: true }));
|
|
64
|
+
return (jsx(OTPVerificationView, { email: email, error: error, onClickBack: handleBackClick, isLoading: isLoading, onPinComplete: onSubmit, isValid: isValid === true, onPinChange: () => setError(undefined), onClickClose: handleOnClickClose, onClickEditEmail: handleBackClick, displayPoweredByDynamic: true, successBannerText: 'Sign in to access your email based wallet' }));
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
export { EmailWalletOTPVerificationView };
|
|
@@ -51,10 +51,10 @@ require('formik');
|
|
|
51
51
|
require('yup');
|
|
52
52
|
require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
53
53
|
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
54
|
+
var capitalize = require('../../../../shared/utils/functions/capitalize/capitalize.cjs');
|
|
54
55
|
var SocialRedirectContext = require('../../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
55
56
|
var OverlayCard = require('../../../../components/OverlayCard/OverlayCard.cjs');
|
|
56
57
|
require('../../../../components/OverlayCard/OverlayCard.context.cjs');
|
|
57
|
-
var capitalize = require('../../../../shared/utils/functions/capitalize/capitalize.cjs');
|
|
58
58
|
|
|
59
59
|
const SocialSignIn = () => {
|
|
60
60
|
const { socialProvidersFilter = (providers) => providers } = useInternalDynamicContext.useInternalDynamicContext();
|
|
@@ -47,10 +47,10 @@ import 'formik';
|
|
|
47
47
|
import 'yup';
|
|
48
48
|
import '../../../../components/InlineWidget/InlineWidget.js';
|
|
49
49
|
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
50
|
+
import { capitalize } from '../../../../shared/utils/functions/capitalize/capitalize.js';
|
|
50
51
|
import { useSocialRedirectContext } from '../../../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
51
52
|
import { OverlayCard } from '../../../../components/OverlayCard/OverlayCard.js';
|
|
52
53
|
import '../../../../components/OverlayCard/OverlayCard.context.js';
|
|
53
|
-
import { capitalize } from '../../../../shared/utils/functions/capitalize/capitalize.js';
|
|
54
54
|
|
|
55
55
|
const SocialSignIn = () => {
|
|
56
56
|
const { socialProvidersFilter = (providers) => providers } = useInternalDynamicContext();
|
|
@@ -53,12 +53,13 @@ var SelectNetworkButton = require('../../components/SelectNetworkButton/SelectNe
|
|
|
53
53
|
var useApplyWalletConnectorNetwork = require('../../utils/hooks/useApplyWalletConnectorNetwork/useApplyWalletConnectorNetwork.cjs');
|
|
54
54
|
|
|
55
55
|
const NetworkNotSupported = () => {
|
|
56
|
-
const { network, onboardingImageUrl, selectedWalletConnector: walletConnector, connectedWallets, primaryWallet, isFullyConnected, setShowAuthFlow, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
56
|
+
const { network, onboardingImageUrl, selectedWalletConnector: walletConnector, connectedWallets, primaryWallet, isFullyConnected, setShowAuthFlow, walletsToConnectByChain, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
57
57
|
// Refresh selectedWalletConnector network when primaryWallet or connectedWallets updates
|
|
58
58
|
const { data: walletConnectorNetwork } = usePromise.usePromise(() => walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(), { deps: [primaryWallet, walletConnector, connectedWallets] });
|
|
59
59
|
const finishConnectAndSign = useConnectAndSign.useConnectAndSign({
|
|
60
60
|
shouldCallCallback: false,
|
|
61
|
-
shouldUpdateWallets: !isFullyConnected
|
|
61
|
+
shouldUpdateWallets: !isFullyConnected ||
|
|
62
|
+
(isFullyConnected && Boolean(walletsToConnectByChain === null || walletsToConnectByChain === void 0 ? void 0 : walletsToConnectByChain.length)),
|
|
62
63
|
});
|
|
63
64
|
const [isNetworkPickerOpen, setIsNetworkPickerOpen] = React.useState(false);
|
|
64
65
|
// Finishes auth flow when wallet switches to proper network
|
|
@@ -49,12 +49,13 @@ import { SelectNetworkButton } from '../../components/SelectNetworkButton/Select
|
|
|
49
49
|
import { useApplyWalletConnectorNetwork } from '../../utils/hooks/useApplyWalletConnectorNetwork/useApplyWalletConnectorNetwork.js';
|
|
50
50
|
|
|
51
51
|
const NetworkNotSupported = () => {
|
|
52
|
-
const { network, onboardingImageUrl, selectedWalletConnector: walletConnector, connectedWallets, primaryWallet, isFullyConnected, setShowAuthFlow, } = useInternalDynamicContext();
|
|
52
|
+
const { network, onboardingImageUrl, selectedWalletConnector: walletConnector, connectedWallets, primaryWallet, isFullyConnected, setShowAuthFlow, walletsToConnectByChain, } = useInternalDynamicContext();
|
|
53
53
|
// Refresh selectedWalletConnector network when primaryWallet or connectedWallets updates
|
|
54
54
|
const { data: walletConnectorNetwork } = usePromise(() => walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(), { deps: [primaryWallet, walletConnector, connectedWallets] });
|
|
55
55
|
const finishConnectAndSign = useConnectAndSign({
|
|
56
56
|
shouldCallCallback: false,
|
|
57
|
-
shouldUpdateWallets: !isFullyConnected
|
|
57
|
+
shouldUpdateWallets: !isFullyConnected ||
|
|
58
|
+
(isFullyConnected && Boolean(walletsToConnectByChain === null || walletsToConnectByChain === void 0 ? void 0 : walletsToConnectByChain.length)),
|
|
58
59
|
});
|
|
59
60
|
const [isNetworkPickerOpen, setIsNetworkPickerOpen] = useState(false);
|
|
60
61
|
// Finishes auth flow when wallet switches to proper network
|
|
@@ -54,14 +54,15 @@ var useApplyWalletConnectorNetwork = require('../../utils/hooks/useApplyWalletCo
|
|
|
54
54
|
// as the wallet does not support programmatic network change.
|
|
55
55
|
const NetworkNotSupportedSwitchManual = () => {
|
|
56
56
|
var _a, _b;
|
|
57
|
-
const { user, selectedWalletConnector: walletConnector, connectedWallets, isFullyConnected, setShowAuthFlow, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
57
|
+
const { user, selectedWalletConnector: walletConnector, connectedWallets, isFullyConnected, setShowAuthFlow, walletsToConnectByChain, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
58
58
|
// Refresh selectedWalletConnector network when primaryWallet or connectedWallets updates
|
|
59
59
|
const { data: walletConnectorNetwork } = usePromise.usePromise(() => walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(), {
|
|
60
60
|
deps: [walletConnector, connectedWallets],
|
|
61
61
|
});
|
|
62
62
|
const finishConnectAndSign = useConnectAndSign.useConnectAndSign({
|
|
63
63
|
shouldCallCallback: false,
|
|
64
|
-
shouldUpdateWallets: !isFullyConnected
|
|
64
|
+
shouldUpdateWallets: !isFullyConnected ||
|
|
65
|
+
(isFullyConnected && Boolean(walletsToConnectByChain === null || walletsToConnectByChain === void 0 ? void 0 : walletsToConnectByChain.length)),
|
|
65
66
|
});
|
|
66
67
|
// Finishes auth flow when wallet switches to proper network
|
|
67
68
|
React.useEffect(() => {
|
|
@@ -50,14 +50,15 @@ import { useApplyWalletConnectorNetwork } from '../../utils/hooks/useApplyWallet
|
|
|
50
50
|
// as the wallet does not support programmatic network change.
|
|
51
51
|
const NetworkNotSupportedSwitchManual = () => {
|
|
52
52
|
var _a, _b;
|
|
53
|
-
const { user, selectedWalletConnector: walletConnector, connectedWallets, isFullyConnected, setShowAuthFlow, } = useInternalDynamicContext();
|
|
53
|
+
const { user, selectedWalletConnector: walletConnector, connectedWallets, isFullyConnected, setShowAuthFlow, walletsToConnectByChain, } = useInternalDynamicContext();
|
|
54
54
|
// Refresh selectedWalletConnector network when primaryWallet or connectedWallets updates
|
|
55
55
|
const { data: walletConnectorNetwork } = usePromise(() => walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.getNetwork(), {
|
|
56
56
|
deps: [walletConnector, connectedWallets],
|
|
57
57
|
});
|
|
58
58
|
const finishConnectAndSign = useConnectAndSign({
|
|
59
59
|
shouldCallCallback: false,
|
|
60
|
-
shouldUpdateWallets: !isFullyConnected
|
|
60
|
+
shouldUpdateWallets: !isFullyConnected ||
|
|
61
|
+
(isFullyConnected && Boolean(walletsToConnectByChain === null || walletsToConnectByChain === void 0 ? void 0 : walletsToConnectByChain.length)),
|
|
61
62
|
});
|
|
62
63
|
// Finishes auth flow when wallet switches to proper network
|
|
63
64
|
useEffect(() => {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
5
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
7
|
var React = require('react');
|
|
7
8
|
var viem = require('viem');
|
|
@@ -51,7 +52,7 @@ require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
|
51
52
|
|
|
52
53
|
const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBack, onClickClose, onError, onSuccess, onDone, displayPoweredByDynamicFooter = false, }) => {
|
|
53
54
|
const [stage, setStage] = React.useState('form');
|
|
54
|
-
const { primaryWallet, network } = useInternalDynamicContext.useInternalDynamicContext();
|
|
55
|
+
const { primaryWallet, network, walletUiUtils } = useInternalDynamicContext.useInternalDynamicContext();
|
|
55
56
|
const [value, setValue] = React.useState(initialValue !== null && initialValue !== void 0 ? initialValue : null);
|
|
56
57
|
const [recipientAddress, setRecipientAddress] = React.useState(initialRecipientAddress);
|
|
57
58
|
const transactionRef = React.useRef(null);
|
|
@@ -86,10 +87,25 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
|
|
|
86
87
|
const transaction = {
|
|
87
88
|
from: primaryWallet.address,
|
|
88
89
|
to: recipientAddress,
|
|
89
|
-
type: 'eip2930',
|
|
90
90
|
value,
|
|
91
91
|
};
|
|
92
|
-
return (jsxRuntime.jsx(TransactionStage.TransactionStage, { walletConnector: walletConnector, provider: provider, transaction: transaction, title: 'Confirm transaction', onClickBack: () => setStage('form'), onError: onError, displayPoweredByDynamicFooter: displayPoweredByDynamicFooter,
|
|
92
|
+
return (jsxRuntime.jsx(TransactionStage.TransactionStage, { walletConnector: walletConnector, provider: provider, transaction: transaction, title: 'Confirm transaction', onClickBack: () => setStage('form'), onError: onError, displayPoweredByDynamicFooter: displayPoweredByDynamicFooter, mutation: ({ to, value, gasPrice, nonce }) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
93
|
+
walletUiUtils.disabledConfirmationOnce();
|
|
94
|
+
const signer = yield walletConnector.getSigner();
|
|
95
|
+
const sentTransaction = yield signer.sendTransaction({
|
|
96
|
+
account: signer.account || primaryWallet.address,
|
|
97
|
+
/**
|
|
98
|
+
* chain is set to null because viem already have the correct chain from the wallet connector
|
|
99
|
+
* docs: https://viem.sh/docs/actions/wallet/sendTransaction.html#chain-optional
|
|
100
|
+
*/
|
|
101
|
+
chain: null,
|
|
102
|
+
gasPrice,
|
|
103
|
+
nonce,
|
|
104
|
+
to,
|
|
105
|
+
value,
|
|
106
|
+
});
|
|
107
|
+
return sentTransaction;
|
|
108
|
+
}), onSuccess: (transaction) => {
|
|
93
109
|
transactionRef.current = transaction;
|
|
94
110
|
setStage('success');
|
|
95
111
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(transactionRef.current);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
1
2
|
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { useState, useRef } from 'react';
|
|
3
4
|
import { parseEther } from 'viem';
|
|
@@ -47,7 +48,7 @@ import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
|
47
48
|
|
|
48
49
|
const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBack, onClickClose, onError, onSuccess, onDone, displayPoweredByDynamicFooter = false, }) => {
|
|
49
50
|
const [stage, setStage] = useState('form');
|
|
50
|
-
const { primaryWallet, network } = useInternalDynamicContext();
|
|
51
|
+
const { primaryWallet, network, walletUiUtils } = useInternalDynamicContext();
|
|
51
52
|
const [value, setValue] = useState(initialValue !== null && initialValue !== void 0 ? initialValue : null);
|
|
52
53
|
const [recipientAddress, setRecipientAddress] = useState(initialRecipientAddress);
|
|
53
54
|
const transactionRef = useRef(null);
|
|
@@ -82,10 +83,25 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
|
|
|
82
83
|
const transaction = {
|
|
83
84
|
from: primaryWallet.address,
|
|
84
85
|
to: recipientAddress,
|
|
85
|
-
type: 'eip2930',
|
|
86
86
|
value,
|
|
87
87
|
};
|
|
88
|
-
return (jsx(TransactionStage, { walletConnector: walletConnector, provider: provider, transaction: transaction, title: 'Confirm transaction', onClickBack: () => setStage('form'), onError: onError, displayPoweredByDynamicFooter: displayPoweredByDynamicFooter,
|
|
88
|
+
return (jsx(TransactionStage, { walletConnector: walletConnector, provider: provider, transaction: transaction, title: 'Confirm transaction', onClickBack: () => setStage('form'), onError: onError, displayPoweredByDynamicFooter: displayPoweredByDynamicFooter, mutation: ({ to, value, gasPrice, nonce }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
89
|
+
walletUiUtils.disabledConfirmationOnce();
|
|
90
|
+
const signer = yield walletConnector.getSigner();
|
|
91
|
+
const sentTransaction = yield signer.sendTransaction({
|
|
92
|
+
account: signer.account || primaryWallet.address,
|
|
93
|
+
/**
|
|
94
|
+
* chain is set to null because viem already have the correct chain from the wallet connector
|
|
95
|
+
* docs: https://viem.sh/docs/actions/wallet/sendTransaction.html#chain-optional
|
|
96
|
+
*/
|
|
97
|
+
chain: null,
|
|
98
|
+
gasPrice,
|
|
99
|
+
nonce,
|
|
100
|
+
to,
|
|
101
|
+
value,
|
|
102
|
+
});
|
|
103
|
+
return sentTransaction;
|
|
104
|
+
}), onSuccess: (transaction) => {
|
|
89
105
|
transactionRef.current = transaction;
|
|
90
106
|
setStage('success');
|
|
91
107
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(transactionRef.current);
|
|
@@ -19,9 +19,10 @@ 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
|
+
require('../../../../context/DynamicContext/DynamicContext.cjs');
|
|
25
26
|
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
26
27
|
require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
27
28
|
require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
@@ -47,27 +48,14 @@ require('../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs')
|
|
|
47
48
|
var useTransactionWithGasPrice = require('../../../../utils/hooks/useTransactionWithGasPrice/useTransactionWithGasPrice.cjs');
|
|
48
49
|
|
|
49
50
|
const TransactionStage = (_a) => {
|
|
50
|
-
var { transaction, provider, walletConnector } = _a, rest = _tslib.__rest(_a, ["transaction", "provider", "walletConnector"]);
|
|
51
|
-
const { walletUiUtils } = useInternalDynamicContext.useInternalDynamicContext();
|
|
51
|
+
var { transaction, provider, walletConnector, mutation } = _a, rest = _tslib.__rest(_a, ["transaction", "provider", "walletConnector", "mutation"]);
|
|
52
52
|
const transactionWithGasPrice = useTransactionWithGasPrice.useTransactionWithGasPrice({
|
|
53
53
|
enabled: isMagicConnector.isMagicConnector(walletConnector),
|
|
54
54
|
increasePercentage: 5,
|
|
55
55
|
provider,
|
|
56
56
|
transaction,
|
|
57
57
|
});
|
|
58
|
-
return (jsxRuntime.jsx(TransactionConfirmationView.TransactionConfirmationView, Object.assign({ provider: provider, transaction: transactionWithGasPrice, mutation: () =>
|
|
59
|
-
walletUiUtils.disabledConfirmationOnce();
|
|
60
|
-
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
|
-
});
|
|
69
|
-
return sentTransaction;
|
|
70
|
-
}) }, rest)));
|
|
58
|
+
return (jsxRuntime.jsx(TransactionConfirmationView.TransactionConfirmationView, Object.assign({ provider: provider, transaction: transactionWithGasPrice, mutation: () => sendTransactionWithAutoNonce.sendTransactionWithAutoNonce(walletConnector, transactionWithGasPrice, mutation) }, rest)));
|
|
71
59
|
};
|
|
72
60
|
|
|
73
61
|
exports.TransactionStage = TransactionStage;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
+
import { Hex, TransactionRequest } from 'viem';
|
|
2
3
|
import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
3
4
|
import { TransactionConfirmationViewProps } from '../../../TransactionConfirmationView';
|
|
4
5
|
type TransactionStageProps = Omit<TransactionConfirmationViewProps, 'mutation'> & {
|
|
5
6
|
walletConnector: WalletConnector;
|
|
7
|
+
mutation: (transaction: TransactionRequest) => Promise<Hex>;
|
|
6
8
|
};
|
|
7
9
|
export declare const TransactionStage: FC<TransactionStageProps>;
|
|
8
10
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __rest
|
|
1
|
+
import { __rest } from '../../../../../../_virtual/_tslib.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@dynamic-labs/utils';
|
|
@@ -15,9 +15,10 @@ 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
|
-
import
|
|
21
|
+
import '../../../../context/DynamicContext/DynamicContext.js';
|
|
21
22
|
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
22
23
|
import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
23
24
|
import '../../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
@@ -43,27 +44,14 @@ import '../../../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
|
43
44
|
import { useTransactionWithGasPrice } from '../../../../utils/hooks/useTransactionWithGasPrice/useTransactionWithGasPrice.js';
|
|
44
45
|
|
|
45
46
|
const TransactionStage = (_a) => {
|
|
46
|
-
var { transaction, provider, walletConnector } = _a, rest = __rest(_a, ["transaction", "provider", "walletConnector"]);
|
|
47
|
-
const { walletUiUtils } = useInternalDynamicContext();
|
|
47
|
+
var { transaction, provider, walletConnector, mutation } = _a, rest = __rest(_a, ["transaction", "provider", "walletConnector", "mutation"]);
|
|
48
48
|
const transactionWithGasPrice = useTransactionWithGasPrice({
|
|
49
49
|
enabled: isMagicConnector(walletConnector),
|
|
50
50
|
increasePercentage: 5,
|
|
51
51
|
provider,
|
|
52
52
|
transaction,
|
|
53
53
|
});
|
|
54
|
-
return (jsx(TransactionConfirmationView, Object.assign({ provider: provider, transaction: transactionWithGasPrice, mutation: () =>
|
|
55
|
-
walletUiUtils.disabledConfirmationOnce();
|
|
56
|
-
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
|
-
});
|
|
65
|
-
return sentTransaction;
|
|
66
|
-
}) }, rest)));
|
|
54
|
+
return (jsx(TransactionConfirmationView, Object.assign({ provider: provider, transaction: transactionWithGasPrice, mutation: () => sendTransactionWithAutoNonce(walletConnector, transactionWithGasPrice, mutation) }, rest)));
|
|
67
55
|
};
|
|
68
56
|
|
|
69
57
|
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 {};
|