@dynamic-labs/sdk-react-core 4.30.0 → 4.30.1
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 +12 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/lib/components/SignMessagePreview/components/SignTypedDataPreview/SignTypedDataPreview.cjs +1 -14
- package/src/lib/components/SignMessagePreview/components/SignTypedDataPreview/SignTypedDataPreview.js +1 -14
- package/src/lib/components/TransactionCard/SendBalanceTransactionCard.cjs +6 -6
- package/src/lib/components/TransactionCard/SendBalanceTransactionCard.js +6 -6
- package/src/lib/components/TransactionCard/TransactionCard.cjs +3 -3
- package/src/lib/components/TransactionCard/TransactionCard.js +3 -3
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +2 -2
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +2 -2
- package/src/lib/components/UserAddress/UserAddress.cjs +11 -11
- package/src/lib/components/UserAddress/UserAddress.js +11 -11
- package/src/lib/components/WalletInformationCard/WalletInformationCard.cjs +1 -11
- package/src/lib/components/WalletInformationCard/WalletInformationCard.js +1 -11
- package/src/lib/events/dynamicEvents.cjs +1 -0
- package/src/lib/events/dynamicEvents.d.ts +1 -1
- package/src/lib/events/dynamicEvents.js +1 -0
- package/src/lib/events/wallets.d.ts +2 -0
- package/src/lib/shared/utils/functions/chain/getChainIcon.cjs +1 -0
- package/src/lib/shared/utils/functions/chain/getChainIcon.js +2 -1
- package/src/lib/shared/utils/functions/index.d.ts +0 -1
- package/src/lib/shared/utils/functions/shortenWalletAddress/index.d.ts +1 -1
- package/src/lib/shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs +9 -3
- package/src/lib/shared/utils/functions/shortenWalletAddress/shortenWalletAddress.d.ts +1 -1
- package/src/lib/shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js +9 -3
- package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.d.ts +1 -1
- package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.cjs +2 -0
- package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.js +2 -0
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +2 -2
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +2 -2
- package/src/lib/views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.cjs +1 -1
- package/src/lib/views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.js +1 -1
- package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.cjs +2 -2
- package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.js +2 -2
- package/src/lib/views/NoAccess/NoAccess.cjs +2 -2
- package/src/lib/views/NoAccess/NoAccess.js +2 -2
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +2 -2
- package/src/lib/views/SendBalanceView/SendBalanceView.js +2 -2
- package/src/lib/views/SyncWalletView/AutoReconnectingView/AutoReconnectingView.cjs +8 -8
- package/src/lib/views/SyncWalletView/AutoReconnectingView/AutoReconnectingView.js +8 -8
- package/src/lib/views/SyncWalletView/ReconnectWithQrCodeView/ReconnectWithQrCodeView.cjs +3 -1
- package/src/lib/views/SyncWalletView/ReconnectWithQrCodeView/ReconnectWithQrCodeView.js +3 -1
- package/src/lib/views/SyncWalletView/SwitchWalletView/SwitchWalletView.cjs +2 -2
- package/src/lib/views/SyncWalletView/SwitchWalletView/SwitchWalletView.js +2 -2
- package/src/lib/views/WalletAlreadyExistsView/WalletAlreadyExistsView.cjs +1 -1
- package/src/lib/views/WalletAlreadyExistsView/WalletAlreadyExistsView.js +1 -1
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.cjs +1 -1
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.js +1 -1
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -1
- package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.js +3 -3
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/ConfirmExchangeTransferView/ConfirmExchangeTransferView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ConfirmExchangeTransferView/ConfirmExchangeTransferView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/DepositView/DepositView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/DepositView/DepositView.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/DepositedExchangeView/DepositedExchangeView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/DepositedExchangeView/DepositedExchangeView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js +1 -1
|
@@ -37,4 +37,6 @@ export type WalletEvents = {
|
|
|
37
37
|
userWalletsPopulated: (userWallets: Wallet[]) => void;
|
|
38
38
|
/** Triggered when Dynamic fails to connect to a wallet */
|
|
39
39
|
walletConnectionFailed: (walletConnector: WalletConnector, error: unknown) => void;
|
|
40
|
+
/** Triggered when a wallet connection QR code is ready */
|
|
41
|
+
walletConnectionQrCodeReady: (qrCodeUri: string) => void;
|
|
40
42
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { AlgorandIcon, BitcoinIcon, CosmosIcon, EclipseIcon, EthereumIcon, FlowIcon, SolanaIcon, StarknetIcon, SuiIcon } from '@dynamic-labs/iconic';
|
|
2
|
+
import { AlgorandIcon, BitcoinIcon, CosmosIcon, EclipseIcon, EthereumIcon, FlowIcon, SolanaIcon, SparkIcon, StarknetIcon, SuiIcon } from '@dynamic-labs/iconic';
|
|
3
3
|
import { getChainInfo } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import 'react';
|
|
5
5
|
import { ReactComponent as SvgError } from '../../../assets/error.js';
|
|
@@ -14,6 +14,7 @@ const chainIconMap = {
|
|
|
14
14
|
evm: EthereumIcon,
|
|
15
15
|
flow: FlowIcon,
|
|
16
16
|
solana: SolanaIcon,
|
|
17
|
+
spark: SparkIcon,
|
|
17
18
|
starknet: StarknetIcon,
|
|
18
19
|
sui: SuiIcon,
|
|
19
20
|
};
|
|
@@ -4,7 +4,6 @@ export * from './chain';
|
|
|
4
4
|
export * from './wallet';
|
|
5
5
|
export * from './getValueByKey';
|
|
6
6
|
export * from './detectBrowser';
|
|
7
|
-
export * from './shortenWalletAddress';
|
|
8
7
|
export * from './debounce';
|
|
9
8
|
export * from './isSSR';
|
|
10
9
|
export * from './isDisplayOrderPriorityForWeb3';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './shortenWalletAddress';
|
|
@@ -3,12 +3,18 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// These are constant to ensure we keep a consistent length for cropped
|
|
7
|
+
// wallet addresses throughout the app.
|
|
8
|
+
const before = 4;
|
|
9
|
+
const after = 4;
|
|
10
|
+
// While it would be useful to export this function, we need to ensure the wallet lengths
|
|
11
|
+
// follow a standard. Therefore, we export the functions with the specific lengths.
|
|
12
|
+
const shortenWalletAddress = (walletAddress) => {
|
|
7
13
|
if (!walletAddress)
|
|
8
14
|
return '';
|
|
9
|
-
if (walletAddress.length <=
|
|
15
|
+
if (walletAddress.length <= before + after)
|
|
10
16
|
return walletAddress;
|
|
11
|
-
return walletAddress.replace(walletAddress.substring(
|
|
17
|
+
return walletAddress.replace(walletAddress.substring(before, Number(walletAddress.length) - after), '...');
|
|
12
18
|
};
|
|
13
19
|
|
|
14
20
|
exports.shortenWalletAddress = shortenWalletAddress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const shortenWalletAddress: (walletAddress: string | undefined
|
|
1
|
+
export declare const shortenWalletAddress: (walletAddress: string | undefined) => string;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
|
|
2
|
+
// These are constant to ensure we keep a consistent length for cropped
|
|
3
|
+
// wallet addresses throughout the app.
|
|
4
|
+
const before = 4;
|
|
5
|
+
const after = 4;
|
|
6
|
+
// While it would be useful to export this function, we need to ensure the wallet lengths
|
|
7
|
+
// follow a standard. Therefore, we export the functions with the specific lengths.
|
|
8
|
+
const shortenWalletAddress = (walletAddress) => {
|
|
3
9
|
if (!walletAddress)
|
|
4
10
|
return '';
|
|
5
|
-
if (walletAddress.length <=
|
|
11
|
+
if (walletAddress.length <= before + after)
|
|
6
12
|
return walletAddress;
|
|
7
|
-
return walletAddress.replace(walletAddress.substring(
|
|
13
|
+
return walletAddress.replace(walletAddress.substring(before, Number(walletAddress.length) - after), '...');
|
|
8
14
|
};
|
|
9
15
|
|
|
10
16
|
export { shortenWalletAddress };
|
|
@@ -4,5 +4,5 @@ type DynamicEventListener<E extends keyof DynamicEvents> = (...args: EventArgs<D
|
|
|
4
4
|
/** Allows us to subscribe to all dynamicEvents with a hook, even the internal ones */
|
|
5
5
|
export declare const useInternalDynamicEvents: <E extends keyof import("../../../../events/auth").AuthEvents | keyof import("../../../../events/ui").UIEvents | keyof import("../../../../events/otp").OTPEvents | keyof import("../../../../events/wallets").WalletEvents | keyof import("../../../../events/passkey").PasskeyEvents | "farcasterConnectCancelled" | keyof import("../../../../events/embeddedWallet").EmbeddedWalletEvents | keyof import("../../../../events/multiWallet").MultiWalletInternalEvents | "tokenBalancesChanged" | "userProfileUpdated" | "walletConnectedForFunding">(event: E, listener: DynamicEventListener<E>) => void;
|
|
6
6
|
/** Allows subscribing to dynamic events directly inside components with a hook */
|
|
7
|
-
export declare const useDynamicEvents: <E extends "authFailure" | "authInit" | "logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "authFlowOpen" | "authFlowClose" | "authFlowCancelled" | "walletTabSelected" | "emailVerificationResult" | "smsVerificationResult" | "walletAdded" | "walletRemoved" | "primaryWalletChanged" | "primaryWalletNetworkChanged" | "userWalletsChanged" | "walletConnectionFailed" | "embeddedWalletCreated" | "walletConnectedForFunding">(event: E, listener: DynamicEventListener<E>) => void;
|
|
7
|
+
export declare const useDynamicEvents: <E extends "authFailure" | "authInit" | "logout" | "mfaCompletionSuccess" | "mfaCompletionFailure" | "authFlowOpen" | "authFlowClose" | "authFlowCancelled" | "walletTabSelected" | "emailVerificationResult" | "smsVerificationResult" | "walletAdded" | "walletRemoved" | "primaryWalletChanged" | "primaryWalletNetworkChanged" | "userWalletsChanged" | "walletConnectionFailed" | "walletConnectionQrCodeReady" | "embeddedWalletCreated" | "walletConnectedForFunding">(event: E, listener: DynamicEventListener<E>) => void;
|
|
8
8
|
export {};
|
package/src/lib/utils/hooks/useWalletItemActions/useHandleWalletItem/useHandleWalletItem.cjs
CHANGED
|
@@ -166,9 +166,11 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
166
166
|
onQrCodeConnect({
|
|
167
167
|
getAddressOpts: {
|
|
168
168
|
onDesktopUri: (uri) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
169
|
+
dynamicEvents.dynamicEvents.emit('walletConnectionQrCodeReady', uri);
|
|
169
170
|
setDesktopUri(uri);
|
|
170
171
|
}),
|
|
171
172
|
onDisplayUri: (uri) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
173
|
+
dynamicEvents.dynamicEvents.emit('walletConnectionQrCodeReady', uri);
|
|
172
174
|
setQrcodeUri(uri);
|
|
173
175
|
}),
|
|
174
176
|
},
|
|
@@ -162,9 +162,11 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
|
|
|
162
162
|
onQrCodeConnect({
|
|
163
163
|
getAddressOpts: {
|
|
164
164
|
onDesktopUri: (uri) => __awaiter(void 0, void 0, void 0, function* () {
|
|
165
|
+
dynamicEvents.emit('walletConnectionQrCodeReady', uri);
|
|
165
166
|
setDesktopUri(uri);
|
|
166
167
|
}),
|
|
167
168
|
onDisplayUri: (uri) => __awaiter(void 0, void 0, void 0, function* () {
|
|
169
|
+
dynamicEvents.emit('walletConnectionQrCodeReady', uri);
|
|
168
170
|
setQrcodeUri(uri);
|
|
169
171
|
}),
|
|
170
172
|
},
|
|
@@ -16,7 +16,6 @@ require('@dynamic-labs/sdk-api-core');
|
|
|
16
16
|
require('../../shared/logger.cjs');
|
|
17
17
|
require('@dynamic-labs/wallet-connector-core');
|
|
18
18
|
require('@dynamic-labs/wallet-book');
|
|
19
|
-
var shortenWalletAddress = require('../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
20
19
|
require('@dynamic-labs/utils');
|
|
21
20
|
require('../../utils/constants/colors.cjs');
|
|
22
21
|
require('../../utils/constants/values.cjs');
|
|
@@ -75,6 +74,7 @@ require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
|
75
74
|
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
76
75
|
require('react-focus-lock');
|
|
77
76
|
var Icon = require('../../components/Icon/Icon.cjs');
|
|
77
|
+
var shortenWalletAddress = require('../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
78
78
|
var AuthProviderIcon = require('../../components/AuthProviderIcon/AuthProviderIcon.cjs');
|
|
79
79
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
80
80
|
require('../../components/IconButton/IconButton.cjs');
|
|
@@ -127,7 +127,7 @@ const CollectUserDataView = () => {
|
|
|
127
127
|
isSupportedNetwork.isSupportedNetwork({ network, walletConnector });
|
|
128
128
|
const shouldDisplayWrongNetworkState = !_isSupportedNetwork && Boolean(walletConnector);
|
|
129
129
|
const walletAddress = (_a = userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.verifiedCredentials.find((verifiedCredential) => verifiedCredential.id === userWithMissingInfo.lastVerifiedCredentialId)) === null || _a === void 0 ? void 0 : _a.address;
|
|
130
|
-
return (jsxRuntime.jsxs("div", { className: 'collect-user-data', "data-testid": 'collect-user-data-view', children: [jsxRuntime.jsxs("div", { className: 'collect-user-data__network-container', children: [jsxRuntime.jsxs("div", { className: 'collect-user-data__img-container', children: [(nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsxRuntime.jsx("img", { src: nameService.avatar, alt: '', className: 'collect-user-data__img collect-user-data__img--rounded' })) : (jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon, { iconSize: 28 })), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data__wallet-address', children: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || shortenWalletAddress.shortenWalletAddress(walletAddress
|
|
130
|
+
return (jsxRuntime.jsxs("div", { className: 'collect-user-data', "data-testid": 'collect-user-data-view', children: [jsxRuntime.jsxs("div", { className: 'collect-user-data__network-container', children: [jsxRuntime.jsxs("div", { className: 'collect-user-data__img-container', children: [(nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsxRuntime.jsx("img", { src: nameService.avatar, alt: '', className: 'collect-user-data__img collect-user-data__img--rounded' })) : (jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon, { iconSize: 28 })), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data__wallet-address', children: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || shortenWalletAddress.shortenWalletAddress(walletAddress) })] }), walletConnector && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { currentNetwork: network, connector: walletConnector, showNetworkName: true, buttonClassName: 'collect-user-data__network-picker-button', mainClassName: 'collect-user-data__network-picker' }))] }), onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data__main-img', src: onboardingImageUrl, alt: 'onboarding' })), shouldDisplayWrongNetworkState && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { withIcon: false, className: 'collect-user-data__error--not-supported', copykey: 'dyn_collect_user_data.not_supported_network.error_message', children: t('dyn_collect_user_data.not_supported_network.error_message') })), jsxRuntime.jsxs("div", { className: classNames.classNames('collect-user-data__form', {
|
|
131
131
|
'collect-user-data__form--error': shouldDisplayWrongNetworkState,
|
|
132
132
|
}), children: [jsxRuntime.jsx("div", { className: 'collect-user-data__success-icon', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'large', children: jsxRuntime.jsx(checkConnection.ReactComponent, {}) }) }), jsxRuntime.jsx(OnboardingUserDataForm.OnboardingUserDataForm, { disableSubmit: shouldDisplayWrongNetworkState, userProfile: userWithMissingInfo, children: shouldDisplayWrongNetworkState ? (jsxRuntime.jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.not_supported_network.title', children: t('dyn_collect_user_data.not_supported_network.title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.not_supported_network.description', children: t('dyn_collect_user_data.not_supported_network.description') })] })) : (jsxRuntime.jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
|
|
133
133
|
t('dyn_collect_user_data.greeting', { appName }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
|
|
@@ -12,7 +12,6 @@ import '@dynamic-labs/sdk-api-core';
|
|
|
12
12
|
import '../../shared/logger.js';
|
|
13
13
|
import '@dynamic-labs/wallet-connector-core';
|
|
14
14
|
import '@dynamic-labs/wallet-book';
|
|
15
|
-
import { shortenWalletAddress } from '../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
|
|
16
15
|
import '@dynamic-labs/utils';
|
|
17
16
|
import '../../utils/constants/colors.js';
|
|
18
17
|
import '../../utils/constants/values.js';
|
|
@@ -71,6 +70,7 @@ import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
|
71
70
|
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
72
71
|
import 'react-focus-lock';
|
|
73
72
|
import { Icon } from '../../components/Icon/Icon.js';
|
|
73
|
+
import { shortenWalletAddress } from '../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
|
|
74
74
|
import { AuthProviderIcon } from '../../components/AuthProviderIcon/AuthProviderIcon.js';
|
|
75
75
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
76
76
|
import '../../components/IconButton/IconButton.js';
|
|
@@ -123,7 +123,7 @@ const CollectUserDataView = () => {
|
|
|
123
123
|
isSupportedNetwork({ network, walletConnector });
|
|
124
124
|
const shouldDisplayWrongNetworkState = !_isSupportedNetwork && Boolean(walletConnector);
|
|
125
125
|
const walletAddress = (_a = userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.verifiedCredentials.find((verifiedCredential) => verifiedCredential.id === userWithMissingInfo.lastVerifiedCredentialId)) === null || _a === void 0 ? void 0 : _a.address;
|
|
126
|
-
return (jsxs("div", { className: 'collect-user-data', "data-testid": 'collect-user-data-view', children: [jsxs("div", { className: 'collect-user-data__network-container', children: [jsxs("div", { className: 'collect-user-data__img-container', children: [(nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsx("img", { src: nameService.avatar, alt: '', className: 'collect-user-data__img collect-user-data__img--rounded' })) : (jsx(AuthProviderIcon, { iconSize: 28 })), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data__wallet-address', children: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || shortenWalletAddress(walletAddress
|
|
126
|
+
return (jsxs("div", { className: 'collect-user-data', "data-testid": 'collect-user-data-view', children: [jsxs("div", { className: 'collect-user-data__network-container', children: [jsxs("div", { className: 'collect-user-data__img-container', children: [(nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsx("img", { src: nameService.avatar, alt: '', className: 'collect-user-data__img collect-user-data__img--rounded' })) : (jsx(AuthProviderIcon, { iconSize: 28 })), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data__wallet-address', children: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || shortenWalletAddress(walletAddress) })] }), walletConnector && (jsx(NetworkPicker, { currentNetwork: network, connector: walletConnector, showNetworkName: true, buttonClassName: 'collect-user-data__network-picker-button', mainClassName: 'collect-user-data__network-picker' }))] }), onboardingImageUrl && (jsx("img", { className: 'collect-user-data__main-img', src: onboardingImageUrl, alt: 'onboarding' })), shouldDisplayWrongNetworkState && (jsx(ErrorContainer, { withIcon: false, className: 'collect-user-data__error--not-supported', copykey: 'dyn_collect_user_data.not_supported_network.error_message', children: t('dyn_collect_user_data.not_supported_network.error_message') })), jsxs("div", { className: classNames('collect-user-data__form', {
|
|
127
127
|
'collect-user-data__form--error': shouldDisplayWrongNetworkState,
|
|
128
128
|
}), children: [jsx("div", { className: 'collect-user-data__success-icon', children: jsx(Icon, { color: 'text-primary', size: 'large', children: jsx(SvgCheckConnection, {}) }) }), jsx(OnboardingUserDataForm, { disableSubmit: shouldDisplayWrongNetworkState, userProfile: userWithMissingInfo, children: shouldDisplayWrongNetworkState ? (jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.not_supported_network.title', children: t('dyn_collect_user_data.not_supported_network.title') }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.not_supported_network.description', children: t('dyn_collect_user_data.not_supported_network.description') })] })) : (jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
|
|
129
129
|
t('dyn_collect_user_data.greeting', { appName }) }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
|
|
@@ -23,7 +23,6 @@ require('../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
|
23
23
|
require('../../shared/logger.cjs');
|
|
24
24
|
require('@dynamic-labs/wallet-connector-core');
|
|
25
25
|
require('@dynamic-labs/wallet-book');
|
|
26
|
-
var shortenWalletAddress = require('../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
27
26
|
require('../../utils/constants/colors.cjs');
|
|
28
27
|
require('../../utils/constants/values.cjs');
|
|
29
28
|
require('../../shared/consts/index.cjs');
|
|
@@ -77,6 +76,7 @@ require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
|
77
76
|
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
78
77
|
require('react-focus-lock');
|
|
79
78
|
var IconWithSpinner = require('../../components/IconWithSpinner/IconWithSpinner.cjs');
|
|
79
|
+
var shortenWalletAddress = require('../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
80
80
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
81
81
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
82
82
|
var IconButton = require('../../components/IconButton/IconButton.cjs');
|
|
@@ -19,7 +19,6 @@ import '../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
|
19
19
|
import '../../shared/logger.js';
|
|
20
20
|
import '@dynamic-labs/wallet-connector-core';
|
|
21
21
|
import '@dynamic-labs/wallet-book';
|
|
22
|
-
import { shortenWalletAddress } from '../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
|
|
23
22
|
import '../../utils/constants/colors.js';
|
|
24
23
|
import '../../utils/constants/values.js';
|
|
25
24
|
import '../../shared/consts/index.js';
|
|
@@ -73,6 +72,7 @@ import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
|
73
72
|
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
74
73
|
import 'react-focus-lock';
|
|
75
74
|
import { iconRatio } from '../../components/IconWithSpinner/IconWithSpinner.js';
|
|
75
|
+
import { shortenWalletAddress } from '../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
|
|
76
76
|
import '../../context/ThemeContext/ThemeContext.js';
|
|
77
77
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
78
78
|
import { IconButton } from '../../components/IconButton/IconButton.js';
|
package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.cjs
CHANGED
|
@@ -16,7 +16,6 @@ var ViewContext = require('../../context/ViewContext/ViewContext.cjs');
|
|
|
16
16
|
require('@dynamic-labs/sdk-api-core');
|
|
17
17
|
require('../../shared/logger.cjs');
|
|
18
18
|
require('@dynamic-labs/wallet-connector-core');
|
|
19
|
-
var shortenWalletAddress = require('../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
20
19
|
require('../../utils/constants/colors.cjs');
|
|
21
20
|
require('../../utils/constants/values.cjs');
|
|
22
21
|
require('../../shared/consts/index.cjs');
|
|
@@ -76,6 +75,7 @@ require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
|
76
75
|
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
77
76
|
require('react-focus-lock');
|
|
78
77
|
var Icon = require('../../components/Icon/Icon.cjs');
|
|
78
|
+
var shortenWalletAddress = require('../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
79
79
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
80
80
|
require('../../components/IconButton/IconButton.cjs');
|
|
81
81
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
@@ -148,7 +148,7 @@ const MergeUserAccountsWithSameEmailView = ({ returnToView }) => {
|
|
|
148
148
|
}
|
|
149
149
|
pushView('collect-user-data');
|
|
150
150
|
};
|
|
151
|
-
return (jsxRuntime.jsxs("div", { className: 'merge-user-accounts-with-same-email__container', children: [jsxRuntime.jsxs("div", { className: 'merge-user-accounts-with-same-email__accounts', children: [jsxRuntime.jsxs("div", { className: 'merge-user-accounts-with-same-email__accounts__item', children: [jsxRuntime.jsx(walletBook.WalletIcon, { icon: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.metadata.icon, walletKey: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.key, className: 'merge-user-accounts-with-same-email__accounts__item__icon' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'medium', color: 'secondary', className: 'merge-user-accounts-with-same-email__accounts__item__text', children: shortenWalletAddress.shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address
|
|
151
|
+
return (jsxRuntime.jsxs("div", { className: 'merge-user-accounts-with-same-email__container', children: [jsxRuntime.jsxs("div", { className: 'merge-user-accounts-with-same-email__accounts', children: [jsxRuntime.jsxs("div", { className: 'merge-user-accounts-with-same-email__accounts__item', children: [jsxRuntime.jsx(walletBook.WalletIcon, { icon: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.metadata.icon, walletKey: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.key, className: 'merge-user-accounts-with-same-email__accounts__item__icon' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'medium', color: 'secondary', className: 'merge-user-accounts-with-same-email__accounts__item__text', children: shortenWalletAddress.shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address) })] }), jsxRuntime.jsx("div", { className: 'merge-user-accounts-with-same-email__accounts__divider', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-secondary', size: 'small', children: jsxRuntime.jsx(doubleArrowRight.ReactComponent, {}) }) }), jsxRuntime.jsxs("div", { className: 'merge-user-accounts-with-same-email__accounts__item', children: [jsxRuntime.jsx(iconic.UserProfileIcon, { className: 'merge-user-accounts-with-same-email__accounts__item__icon' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'medium', color: 'secondary', className: 'merge-user-accounts-with-same-email__accounts__item__text', children: shortenEmail.shortenEmail(email, {
|
|
152
152
|
breakpoint: 4,
|
|
153
153
|
cutEnd: 1,
|
|
154
154
|
cutStart: 2,
|
package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.js
CHANGED
|
@@ -12,7 +12,6 @@ import { useViewContext } from '../../context/ViewContext/ViewContext.js';
|
|
|
12
12
|
import '@dynamic-labs/sdk-api-core';
|
|
13
13
|
import '../../shared/logger.js';
|
|
14
14
|
import '@dynamic-labs/wallet-connector-core';
|
|
15
|
-
import { shortenWalletAddress } from '../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
|
|
16
15
|
import '../../utils/constants/colors.js';
|
|
17
16
|
import '../../utils/constants/values.js';
|
|
18
17
|
import '../../shared/consts/index.js';
|
|
@@ -72,6 +71,7 @@ import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
|
72
71
|
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
73
72
|
import 'react-focus-lock';
|
|
74
73
|
import { Icon } from '../../components/Icon/Icon.js';
|
|
74
|
+
import { shortenWalletAddress } from '../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
|
|
75
75
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
76
76
|
import '../../components/IconButton/IconButton.js';
|
|
77
77
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
@@ -144,7 +144,7 @@ const MergeUserAccountsWithSameEmailView = ({ returnToView }) => {
|
|
|
144
144
|
}
|
|
145
145
|
pushView('collect-user-data');
|
|
146
146
|
};
|
|
147
|
-
return (jsxs("div", { className: 'merge-user-accounts-with-same-email__container', children: [jsxs("div", { className: 'merge-user-accounts-with-same-email__accounts', children: [jsxs("div", { className: 'merge-user-accounts-with-same-email__accounts__item', children: [jsx(WalletIcon, { icon: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.metadata.icon, walletKey: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.key, className: 'merge-user-accounts-with-same-email__accounts__item__icon' }), jsx(Typography, { variant: 'body_normal', weight: 'medium', color: 'secondary', className: 'merge-user-accounts-with-same-email__accounts__item__text', children: shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address
|
|
147
|
+
return (jsxs("div", { className: 'merge-user-accounts-with-same-email__container', children: [jsxs("div", { className: 'merge-user-accounts-with-same-email__accounts', children: [jsxs("div", { className: 'merge-user-accounts-with-same-email__accounts__item', children: [jsx(WalletIcon, { icon: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.metadata.icon, walletKey: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.key, className: 'merge-user-accounts-with-same-email__accounts__item__icon' }), jsx(Typography, { variant: 'body_normal', weight: 'medium', color: 'secondary', className: 'merge-user-accounts-with-same-email__accounts__item__text', children: shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address) })] }), jsx("div", { className: 'merge-user-accounts-with-same-email__accounts__divider', children: jsx(Icon, { color: 'text-secondary', size: 'small', children: jsx(SvgDoubleArrowRight, {}) }) }), jsxs("div", { className: 'merge-user-accounts-with-same-email__accounts__item', children: [jsx(UserProfileIcon, { className: 'merge-user-accounts-with-same-email__accounts__item__icon' }), jsx(Typography, { variant: 'body_normal', weight: 'medium', color: 'secondary', className: 'merge-user-accounts-with-same-email__accounts__item__text', children: shortenEmail(email, {
|
|
148
148
|
breakpoint: 4,
|
|
149
149
|
cutEnd: 1,
|
|
150
150
|
cutStart: 2,
|
|
@@ -16,7 +16,6 @@ require('@dynamic-labs/sdk-api-core');
|
|
|
16
16
|
require('../../shared/logger.cjs');
|
|
17
17
|
require('@dynamic-labs/wallet-connector-core');
|
|
18
18
|
require('@dynamic-labs/wallet-book');
|
|
19
|
-
var shortenWalletAddress = require('../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
20
19
|
require('../../utils/constants/colors.cjs');
|
|
21
20
|
require('../../utils/constants/values.cjs');
|
|
22
21
|
require('../../shared/consts/index.cjs');
|
|
@@ -73,6 +72,7 @@ require('../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cj
|
|
|
73
72
|
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
74
73
|
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
75
74
|
require('react-focus-lock');
|
|
75
|
+
var shortenWalletAddress = require('../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
76
76
|
var AuthProviderIcon = require('../../components/AuthProviderIcon/AuthProviderIcon.cjs');
|
|
77
77
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
78
78
|
require('../../components/IconButton/IconButton.cjs');
|
|
@@ -138,7 +138,7 @@ const NoAccess = () => {
|
|
|
138
138
|
}
|
|
139
139
|
return (jsxRuntime.jsx(IconWithStatus.IconWithStatus, { containerClassName: 'wallet-no-access__icon--verified', Icon: accessIcon !== null && accessIcon !== void 0 ? accessIcon : iconic.SignInWithEmailIcon, iconSize: 50, InnerIcon: error.ReactComponent, variant: 'red' }));
|
|
140
140
|
}, [accessIcon, walletConnector]);
|
|
141
|
-
const formattedAddress = shortenWalletAddress.shortenWalletAddress(deniedAddress
|
|
141
|
+
const formattedAddress = shortenWalletAddress.shortenWalletAddress(deniedAddress);
|
|
142
142
|
const buttonTitle = (accessDeniedButton === null || accessDeniedButton === void 0 ? void 0 : accessDeniedButton.title) || _buttonTitle;
|
|
143
143
|
const buttonAction = (accessDeniedButton === null || accessDeniedButton === void 0 ? void 0 : accessDeniedButton.action) || handleChangeWallet;
|
|
144
144
|
const emailOrAddress = email !== null && email !== void 0 ? email : formattedAddress;
|
|
@@ -12,7 +12,6 @@ import '@dynamic-labs/sdk-api-core';
|
|
|
12
12
|
import '../../shared/logger.js';
|
|
13
13
|
import '@dynamic-labs/wallet-connector-core';
|
|
14
14
|
import '@dynamic-labs/wallet-book';
|
|
15
|
-
import { shortenWalletAddress } from '../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
|
|
16
15
|
import '../../utils/constants/colors.js';
|
|
17
16
|
import '../../utils/constants/values.js';
|
|
18
17
|
import '../../shared/consts/index.js';
|
|
@@ -69,6 +68,7 @@ import '../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js'
|
|
|
69
68
|
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
70
69
|
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
71
70
|
import 'react-focus-lock';
|
|
71
|
+
import { shortenWalletAddress } from '../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
|
|
72
72
|
import { AuthProviderIcon } from '../../components/AuthProviderIcon/AuthProviderIcon.js';
|
|
73
73
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
74
74
|
import '../../components/IconButton/IconButton.js';
|
|
@@ -134,7 +134,7 @@ const NoAccess = () => {
|
|
|
134
134
|
}
|
|
135
135
|
return (jsx(IconWithStatus, { containerClassName: 'wallet-no-access__icon--verified', Icon: accessIcon !== null && accessIcon !== void 0 ? accessIcon : SignInWithEmailIcon, iconSize: 50, InnerIcon: SvgError, variant: 'red' }));
|
|
136
136
|
}, [accessIcon, walletConnector]);
|
|
137
|
-
const formattedAddress = shortenWalletAddress(deniedAddress
|
|
137
|
+
const formattedAddress = shortenWalletAddress(deniedAddress);
|
|
138
138
|
const buttonTitle = (accessDeniedButton === null || accessDeniedButton === void 0 ? void 0 : accessDeniedButton.title) || _buttonTitle;
|
|
139
139
|
const buttonAction = (accessDeniedButton === null || accessDeniedButton === void 0 ? void 0 : accessDeniedButton.action) || handleChangeWallet;
|
|
140
140
|
const emailOrAddress = email !== null && email !== void 0 ? email : formattedAddress;
|
|
@@ -20,7 +20,6 @@ var logger = require('../../shared/logger.cjs');
|
|
|
20
20
|
require('@dynamic-labs/iconic');
|
|
21
21
|
require('../../context/ViewContext/ViewContext.cjs');
|
|
22
22
|
require('@dynamic-labs/wallet-book');
|
|
23
|
-
var shortenWalletAddress = require('../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
24
23
|
require('../../utils/constants/colors.cjs');
|
|
25
24
|
require('../../utils/constants/values.cjs');
|
|
26
25
|
require('../../shared/consts/index.cjs');
|
|
@@ -81,6 +80,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
81
80
|
require('react-focus-lock');
|
|
82
81
|
require('qrcode');
|
|
83
82
|
var useFetchChain = require('../../widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.cjs');
|
|
83
|
+
var shortenWalletAddress = require('../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
84
84
|
require('formik');
|
|
85
85
|
require('../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
|
|
86
86
|
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
@@ -210,7 +210,7 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
|
|
|
210
210
|
const currencyIcon = (chain === null || chain === void 0 ? void 0 : chain.name) && (jsxRuntime.jsx(ChainIcon.ChainIcon, { chain: chain, chainName: chain.name }));
|
|
211
211
|
const buildFormStage = () => (jsxRuntime.jsx(SendBalancePageLayout.SendBalancePageLayout, { transaction: transaction, onClickBack: onClickBack, networkName: networkData.vanityName || networkData.name, networkIcon: currencyIcon, networkCurrencyDecimals: networkData.nativeCurrency.symbol === 'SOL'
|
|
212
212
|
? 9
|
|
213
|
-
: networkData.nativeCurrency.decimals, walletAddress: shortenWalletAddress.shortenWalletAddress(currentToken === null || currentToken === void 0 ? void 0 : currentToken.address
|
|
213
|
+
: networkData.nativeCurrency.decimals, walletAddress: shortenWalletAddress.shortenWalletAddress(currentToken === null || currentToken === void 0 ? void 0 : currentToken.address), walletKey: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.key, onClickClose: onClickClose, displayPoweredByDynamicFooter: displayPoweredByDynamicFooter, onSubmit: () => setStage('confirmation'), tokenBalances: tokenBalances !== null && tokenBalances !== void 0 ? tokenBalances : (currentToken && [currentToken]), currentToken: currentToken, setCurrentToken: setCurrentToken, isLoading: isLoading, isNativeToken: isNativeToken }));
|
|
214
214
|
const buildTransactionStage = () => (jsxRuntime.jsx(TransactionConfirmationView.TransactionConfirmationView, { walletConnector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, transaction: transaction, mutation: () => {
|
|
215
215
|
walletUiUtils.disabledConfirmationOnce();
|
|
216
216
|
return transaction.submit();
|
|
@@ -16,7 +16,6 @@ import { logger } from '../../shared/logger.js';
|
|
|
16
16
|
import '@dynamic-labs/iconic';
|
|
17
17
|
import '../../context/ViewContext/ViewContext.js';
|
|
18
18
|
import '@dynamic-labs/wallet-book';
|
|
19
|
-
import { shortenWalletAddress } from '../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
|
|
20
19
|
import '../../utils/constants/colors.js';
|
|
21
20
|
import '../../utils/constants/values.js';
|
|
22
21
|
import '../../shared/consts/index.js';
|
|
@@ -77,6 +76,7 @@ import '../../components/Popper/PopperContext/PopperContext.js';
|
|
|
77
76
|
import 'react-focus-lock';
|
|
78
77
|
import 'qrcode';
|
|
79
78
|
import { useFetchChain } from '../../widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.js';
|
|
79
|
+
import { shortenWalletAddress } from '../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
|
|
80
80
|
import 'formik';
|
|
81
81
|
import '../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
|
|
82
82
|
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
@@ -206,7 +206,7 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
|
|
|
206
206
|
const currencyIcon = (chain === null || chain === void 0 ? void 0 : chain.name) && (jsx(ChainIcon, { chain: chain, chainName: chain.name }));
|
|
207
207
|
const buildFormStage = () => (jsx(SendBalancePageLayout, { transaction: transaction, onClickBack: onClickBack, networkName: networkData.vanityName || networkData.name, networkIcon: currencyIcon, networkCurrencyDecimals: networkData.nativeCurrency.symbol === 'SOL'
|
|
208
208
|
? 9
|
|
209
|
-
: networkData.nativeCurrency.decimals, walletAddress: shortenWalletAddress(currentToken === null || currentToken === void 0 ? void 0 : currentToken.address
|
|
209
|
+
: networkData.nativeCurrency.decimals, walletAddress: shortenWalletAddress(currentToken === null || currentToken === void 0 ? void 0 : currentToken.address), walletKey: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.key, onClickClose: onClickClose, displayPoweredByDynamicFooter: displayPoweredByDynamicFooter, onSubmit: () => setStage('confirmation'), tokenBalances: tokenBalances !== null && tokenBalances !== void 0 ? tokenBalances : (currentToken && [currentToken]), currentToken: currentToken, setCurrentToken: setCurrentToken, isLoading: isLoading, isNativeToken: isNativeToken }));
|
|
210
210
|
const buildTransactionStage = () => (jsx(TransactionConfirmationView, { walletConnector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, transaction: transaction, mutation: () => {
|
|
211
211
|
walletUiUtils.disabledConfirmationOnce();
|
|
212
212
|
return transaction.submit();
|
|
@@ -8,18 +8,17 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
8
8
|
var reactI18next = require('react-i18next');
|
|
9
9
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
10
10
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
11
|
-
require('
|
|
12
|
-
require('
|
|
13
|
-
require('
|
|
11
|
+
var DefaultPromptModal = require('../../../widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.cjs');
|
|
12
|
+
require('@dynamic-labs/utils');
|
|
13
|
+
require('../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
14
14
|
require('react');
|
|
15
|
+
require('@dynamic-labs/iconic');
|
|
15
16
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
16
|
-
|
|
17
|
-
require('
|
|
17
|
+
require('@dynamic-labs/sdk-api-core');
|
|
18
|
+
require('../../../shared/logger.cjs');
|
|
18
19
|
require('../../../utils/constants/colors.cjs');
|
|
19
20
|
require('../../../utils/constants/values.cjs');
|
|
20
21
|
require('../../../shared/consts/index.cjs');
|
|
21
|
-
var DefaultPromptModal = require('../../../widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.cjs');
|
|
22
|
-
require('../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
23
22
|
require('../../../components/Alert/Alert.cjs');
|
|
24
23
|
require('../../../events/dynamicEvents.cjs');
|
|
25
24
|
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
@@ -73,6 +72,7 @@ require('../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget
|
|
|
73
72
|
require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
74
73
|
require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
75
74
|
require('react-focus-lock');
|
|
75
|
+
var shortenWalletAddress = require('../../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
76
76
|
require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
77
77
|
require('../../../components/IconButton/IconButton.cjs');
|
|
78
78
|
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
@@ -117,7 +117,7 @@ const AutoReconnectingView = ({ onCancel, onSuccess, connector, expectedAddress,
|
|
|
117
117
|
}
|
|
118
118
|
}), { deps: [connector] });
|
|
119
119
|
return (jsxRuntime.jsx(DefaultPromptModal.DefaultPromptModal, { dataTestId: 'auto-reconnecting', icon: jsxRuntime.jsx(walletBook.WalletIcon, { icon: connector.metadata.icon, walletKey: connector.key }), title: t('dyn_sync_wallet.reconnecting.title'), onClose: onCancel, children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_sync_wallet.reconnecting.description', children: t('dyn_sync_wallet.reconnecting.description', {
|
|
120
|
-
walletAddress: shortenWalletAddress.shortenWalletAddress(expectedAddress
|
|
120
|
+
walletAddress: shortenWalletAddress.shortenWalletAddress(expectedAddress),
|
|
121
121
|
}) }) }));
|
|
122
122
|
};
|
|
123
123
|
|
|
@@ -4,18 +4,17 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
6
6
|
import { isSocialWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
7
|
-
import '
|
|
8
|
-
import '
|
|
9
|
-
import '
|
|
7
|
+
import { DefaultPromptModal } from '../../../widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.js';
|
|
8
|
+
import '@dynamic-labs/utils';
|
|
9
|
+
import '../../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
10
10
|
import 'react';
|
|
11
|
+
import '@dynamic-labs/iconic';
|
|
11
12
|
import '../../../context/ViewContext/ViewContext.js';
|
|
12
|
-
import
|
|
13
|
-
import '
|
|
13
|
+
import '@dynamic-labs/sdk-api-core';
|
|
14
|
+
import '../../../shared/logger.js';
|
|
14
15
|
import '../../../utils/constants/colors.js';
|
|
15
16
|
import '../../../utils/constants/values.js';
|
|
16
17
|
import '../../../shared/consts/index.js';
|
|
17
|
-
import { DefaultPromptModal } from '../../../widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.js';
|
|
18
|
-
import '../../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
19
18
|
import '../../../components/Alert/Alert.js';
|
|
20
19
|
import '../../../events/dynamicEvents.js';
|
|
21
20
|
import '../../../context/DynamicContext/DynamicContext.js';
|
|
@@ -69,6 +68,7 @@ import '../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.
|
|
|
69
68
|
import '../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
70
69
|
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
71
70
|
import 'react-focus-lock';
|
|
71
|
+
import { shortenWalletAddress } from '../../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
|
|
72
72
|
import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
73
73
|
import '../../../components/IconButton/IconButton.js';
|
|
74
74
|
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
@@ -113,7 +113,7 @@ const AutoReconnectingView = ({ onCancel, onSuccess, connector, expectedAddress,
|
|
|
113
113
|
}
|
|
114
114
|
}), { deps: [connector] });
|
|
115
115
|
return (jsx(DefaultPromptModal, { dataTestId: 'auto-reconnecting', icon: jsx(WalletIcon, { icon: connector.metadata.icon, walletKey: connector.key }), title: t('dyn_sync_wallet.reconnecting.title'), onClose: onCancel, children: jsx(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', copykey: 'dyn_sync_wallet.reconnecting.description', children: t('dyn_sync_wallet.reconnecting.description', {
|
|
116
|
-
walletAddress: shortenWalletAddress(expectedAddress
|
|
116
|
+
walletAddress: shortenWalletAddress(expectedAddress),
|
|
117
117
|
}) }) }));
|
|
118
118
|
};
|
|
119
119
|
|
|
@@ -20,7 +20,7 @@ require('../../../utils/constants/colors.cjs');
|
|
|
20
20
|
require('../../../utils/constants/values.cjs');
|
|
21
21
|
require('../../../shared/consts/index.cjs');
|
|
22
22
|
require('../../../components/Alert/Alert.cjs');
|
|
23
|
-
require('../../../events/dynamicEvents.cjs');
|
|
23
|
+
var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
24
24
|
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
25
25
|
require('../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
26
26
|
require('../../../store/state/authMode/authMode.cjs');
|
|
@@ -120,9 +120,11 @@ const ReconnectWithQrCodeView = ({ onCancel, onSuccess, connector, expectedAddre
|
|
|
120
120
|
triggeredGetAddress.current = true;
|
|
121
121
|
const publicAddress = yield connector.getAddress({
|
|
122
122
|
onDesktopUri: (uri) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
123
|
+
dynamicEvents.dynamicEvents.emit('walletConnectionQrCodeReady', uri);
|
|
123
124
|
setDesktopUri(uri);
|
|
124
125
|
}),
|
|
125
126
|
onDisplayUri: (uri) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
127
|
+
dynamicEvents.dynamicEvents.emit('walletConnectionQrCodeReady', uri);
|
|
126
128
|
setQrcodeUri(uri);
|
|
127
129
|
}),
|
|
128
130
|
});
|
|
@@ -16,7 +16,7 @@ import '../../../utils/constants/colors.js';
|
|
|
16
16
|
import '../../../utils/constants/values.js';
|
|
17
17
|
import '../../../shared/consts/index.js';
|
|
18
18
|
import '../../../components/Alert/Alert.js';
|
|
19
|
-
import '../../../events/dynamicEvents.js';
|
|
19
|
+
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
20
20
|
import '../../../context/DynamicContext/DynamicContext.js';
|
|
21
21
|
import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
22
22
|
import '../../../store/state/authMode/authMode.js';
|
|
@@ -116,9 +116,11 @@ const ReconnectWithQrCodeView = ({ onCancel, onSuccess, connector, expectedAddre
|
|
|
116
116
|
triggeredGetAddress.current = true;
|
|
117
117
|
const publicAddress = yield connector.getAddress({
|
|
118
118
|
onDesktopUri: (uri) => __awaiter(void 0, void 0, void 0, function* () {
|
|
119
|
+
dynamicEvents.emit('walletConnectionQrCodeReady', uri);
|
|
119
120
|
setDesktopUri(uri);
|
|
120
121
|
}),
|
|
121
122
|
onDisplayUri: (uri) => __awaiter(void 0, void 0, void 0, function* () {
|
|
123
|
+
dynamicEvents.emit('walletConnectionQrCodeReady', uri);
|
|
122
124
|
setQrcodeUri(uri);
|
|
123
125
|
}),
|
|
124
126
|
});
|
|
@@ -14,7 +14,6 @@ require('@dynamic-labs/wallet-connector-core');
|
|
|
14
14
|
require('react');
|
|
15
15
|
var arrowCircleRight = require('../../../shared/assets/arrow-circle-right.cjs');
|
|
16
16
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
17
|
-
var shortenWalletAddress = require('../../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
18
17
|
require('@dynamic-labs/utils');
|
|
19
18
|
require('../../../utils/constants/colors.cjs');
|
|
20
19
|
require('../../../utils/constants/values.cjs');
|
|
@@ -72,6 +71,7 @@ require('../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget
|
|
|
72
71
|
require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
73
72
|
require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
74
73
|
require('react-focus-lock');
|
|
74
|
+
var shortenWalletAddress = require('../../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
|
|
75
75
|
var Divider = require('../../../components/Divider/Divider.cjs');
|
|
76
76
|
require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
77
77
|
require('../../../components/IconButton/IconButton.cjs');
|
|
@@ -108,7 +108,7 @@ require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
108
108
|
|
|
109
109
|
const SwitchWalletView = ({ onCancel, connector, expectedAddress, activeAddress, }) => {
|
|
110
110
|
const { t } = reactI18next.useTranslation();
|
|
111
|
-
return (jsxRuntime.jsx(DefaultPromptModal.DefaultPromptModal, { dataTestId: 'switch-wallet', className: 'switch-wallet', icon: jsxRuntime.jsx(walletBook.WalletIcon, { icon: connector.metadata.icon, walletKey: connector.key }), title: t('dyn_sync_wallet.switch_wallet.title'), onClose: onCancel, children: jsxRuntime.jsxs("div", { className: 'switch-wallet__body', children: [activeAddress && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', color: 'secondary', weight: 'regular', copykey: 'dyn_sync_wallet.switch_wallet.active_address.heading', children: t('dyn_sync_wallet.switch_wallet.active_address.heading') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'regular', children: shortenWalletAddress.shortenWalletAddress(activeAddress
|
|
111
|
+
return (jsxRuntime.jsx(DefaultPromptModal.DefaultPromptModal, { dataTestId: 'switch-wallet', className: 'switch-wallet', icon: jsxRuntime.jsx(walletBook.WalletIcon, { icon: connector.metadata.icon, walletKey: connector.key }), title: t('dyn_sync_wallet.switch_wallet.title'), onClose: onCancel, children: jsxRuntime.jsxs("div", { className: 'switch-wallet__body', children: [activeAddress && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', color: 'secondary', weight: 'regular', copykey: 'dyn_sync_wallet.switch_wallet.active_address.heading', children: t('dyn_sync_wallet.switch_wallet.active_address.heading') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'regular', children: shortenWalletAddress.shortenWalletAddress(activeAddress) }), jsxRuntime.jsx(Divider.Divider, { className: 'switch-wallet__body__divider', children: jsxRuntime.jsx(arrowCircleRight.ReactComponent, {}) })] })), jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', color: 'secondary', weight: 'regular', copykey: 'dyn_sync_wallet.switch_wallet.expected_address.heading', children: t('dyn_sync_wallet.switch_wallet.expected_address.heading') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'regular', copykey: 'dyn_sync_wallet.switch_wallet.expected_address.prompt', className: 'switch-wallet__body__expected-address__prompt', children: t('dyn_sync_wallet.switch_wallet.expected_address.prompt') }), jsxRuntime.jsx(Typography.Typography, { color: 'green-1', weight: 'bold', className: 'switch-wallet__body__expected-address__address', children: shortenWalletAddress.shortenWalletAddress(expectedAddress) })] }) }));
|
|
112
112
|
};
|
|
113
113
|
|
|
114
114
|
exports.SwitchWalletView = SwitchWalletView;
|