@dynamic-labs/sdk-react-core 4.81.0 → 4.83.0

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +13 -13
  5. package/src/lib/data/api/aleo/getAleoCuratedPrices.cjs +73 -0
  6. package/src/lib/data/api/aleo/getAleoCuratedPrices.d.ts +38 -0
  7. package/src/lib/data/api/aleo/getAleoCuratedPrices.js +69 -0
  8. package/src/lib/shared/assets/index.d.ts +2 -0
  9. package/src/lib/shared/assets/midnight-shielded.cjs +54 -0
  10. package/src/lib/shared/assets/midnight-shielded.js +30 -0
  11. package/src/lib/shared/assets/midnight-unshielded.cjs +54 -0
  12. package/src/lib/shared/assets/midnight-unshielded.js +30 -0
  13. package/src/lib/styles/index.shadow.cjs +1 -1
  14. package/src/lib/styles/index.shadow.js +1 -1
  15. package/src/lib/utils/functions/compareChains/compareChains.cjs +1 -0
  16. package/src/lib/utils/functions/compareChains/compareChains.js +1 -0
  17. package/src/lib/utils/functions/getTransactionLink/blockExplorerPatterns.cjs +12 -0
  18. package/src/lib/utils/functions/getTransactionLink/blockExplorerPatterns.js +12 -0
  19. package/src/lib/utils/hooks/useAleoAutoMergeRecords/index.d.ts +1 -0
  20. package/src/lib/utils/hooks/useAleoAutoMergeRecords/useAleoAutoMergeRecords.cjs +246 -0
  21. package/src/lib/utils/hooks/useAleoAutoMergeRecords/useAleoAutoMergeRecords.d.ts +17 -0
  22. package/src/lib/utils/hooks/useAleoAutoMergeRecords/useAleoAutoMergeRecords.js +242 -0
  23. package/src/lib/utils/hooks/useAleoAutoShieldSponsoredTokens/index.d.ts +1 -0
  24. package/src/lib/utils/hooks/useAleoAutoShieldSponsoredTokens/useAleoAutoShieldSponsoredTokens.cjs +263 -0
  25. package/src/lib/utils/hooks/useAleoAutoShieldSponsoredTokens/useAleoAutoShieldSponsoredTokens.d.ts +59 -0
  26. package/src/lib/utils/hooks/useAleoAutoShieldSponsoredTokens/useAleoAutoShieldSponsoredTokens.js +259 -0
  27. package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.cjs +139 -68
  28. package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.js +139 -68
  29. package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.cjs +12 -1
  30. package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.js +12 -1
  31. package/src/lib/widgets/DynamicWidget/components/ActiveMidnightWalletBalance/ActiveMidnightWalletBalance.cjs +193 -0
  32. package/src/lib/widgets/DynamicWidget/components/ActiveMidnightWalletBalance/ActiveMidnightWalletBalance.d.ts +7 -0
  33. package/src/lib/widgets/DynamicWidget/components/ActiveMidnightWalletBalance/ActiveMidnightWalletBalance.js +189 -0
  34. package/src/lib/widgets/DynamicWidget/components/ActiveMidnightWalletBalance/index.d.ts +1 -0
  35. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.cjs +26 -1
  36. package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.js +26 -1
  37. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveMidnightWalletAddresses/ActiveMidnightWalletAddresses.cjs +124 -0
  38. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveMidnightWalletAddresses/ActiveMidnightWalletAddresses.d.ts +9 -0
  39. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveMidnightWalletAddresses/ActiveMidnightWalletAddresses.js +120 -0
  40. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveMidnightWalletAddresses/index.d.ts +1 -0
  41. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +21 -10
  42. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +22 -11
  43. package/src/lib/widgets/DynamicWidget/components/WalletDetailsCard/WalletDetailsCard.cjs +22 -2
  44. package/src/lib/widgets/DynamicWidget/components/WalletDetailsCard/WalletDetailsCard.d.ts +8 -1
  45. package/src/lib/widgets/DynamicWidget/components/WalletDetailsCard/WalletDetailsCard.js +23 -3
@@ -0,0 +1,124 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+ var reactI18next = require('react-i18next');
8
+ require('../../../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
9
+ require('react');
10
+ require('@dynamic-labs/iconic');
11
+ require('../../../../../context/ViewContext/ViewContext.cjs');
12
+ require('../../../../../../../_virtual/_tslib.cjs');
13
+ require('@dynamic-labs/utils');
14
+ require('@dynamic-labs/wallet-connector-core');
15
+ require('../../../../../shared/logger.cjs');
16
+ require('@dynamic-labs/wallet-book');
17
+ require('../../../../../utils/constants/colors.cjs');
18
+ require('../../../../../utils/constants/values.cjs');
19
+ require('@dynamic-labs/sdk-api-core');
20
+ require('../../../../../shared/consts/index.cjs');
21
+ require('../../../../../components/Alert/Alert.cjs');
22
+ require('../../../../../events/dynamicEvents.cjs');
23
+ require('../../../../../context/DynamicContext/DynamicContext.cjs');
24
+ require('../../../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
25
+ require('../../../../../store/state/authMode/authMode.cjs');
26
+ require('../../../../../context/CaptchaContext/CaptchaContext.cjs');
27
+ require('../../../../../context/ErrorContext/ErrorContext.cjs');
28
+ require('@dynamic-labs/multi-wallet');
29
+ require('react-international-phone');
30
+ require('../../../../../store/state/nonce/nonce.cjs');
31
+ require('@dynamic-labs-sdk/client/core');
32
+ require('eventemitter3');
33
+ require('@dynamic-labs-sdk/client');
34
+ require('../../../../../config/ApiEndpoint.cjs');
35
+ require('@dynamic-labs/locale');
36
+ require('../../../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
37
+ require('../../../../../store/state/primaryWalletId/primaryWalletId.cjs');
38
+ require('../../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
39
+ require('../../../../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');
40
+ require('../../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
41
+ require('../../../../../context/AccountExistsContext/AccountExistsContext.cjs');
42
+ require('../../../../../context/UserWalletsContext/UserWalletsContext.cjs');
43
+ require('../../../../../context/VerificationContext/VerificationContext.cjs');
44
+ require('react-dom');
45
+ require('../../../../../utils/functions/compareChains/compareChains.cjs');
46
+ require('../../../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
47
+ require('../../../../../context/ThemeContext/ThemeContext.cjs');
48
+ require('../../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
49
+ require('bs58');
50
+ require('@dynamic-labs/types');
51
+ require('../../../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
52
+ require('../../../../../context/LoadingContext/LoadingContext.cjs');
53
+ require('../../../../../context/WalletContext/WalletContext.cjs');
54
+ require('../../../../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
55
+ require('yup');
56
+ require('../../../../../context/MockContext/MockContext.cjs');
57
+ require('../../../../../views/CollectUserDataView/useFields.cjs');
58
+ require('../../../../../context/FieldsStateContext/FieldsStateContext.cjs');
59
+ require('../../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
60
+ require('@dynamic-labs/rpc-providers');
61
+ require('../../../../../store/state/walletOptions/walletOptions.cjs');
62
+ var Typography = require('../../../../../components/Typography/Typography.cjs');
63
+ require('../../../../../context/FooterAnimationContext/index.cjs');
64
+ require('../../../../../components/ShadowDOM/ShadowDOM.cjs');
65
+ require('../../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
66
+ require('../../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
67
+ require('../../../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
68
+ require('../../../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
69
+ require('../../../../../context/WalletGroupContext/WalletGroupContext.cjs');
70
+ require('../../DynamicWidgetHeader/DynamicWidgetHeader.cjs');
71
+ require('react-focus-lock');
72
+ var shortenWalletAddress = require('../../../../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
73
+ require('../../../context/DynamicWidgetContext.cjs');
74
+ require('../../../../../components/IconButton/IconButton.cjs');
75
+ require('../../../../../utils/hooks/useGetMfaToken/useGetMfaToken.cjs');
76
+ var DotsMenu = require('../../DotsMenu/DotsMenu.cjs');
77
+ require('formik');
78
+ require('../../../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
79
+ require('../../../../../store/state/sendBalances.cjs');
80
+ require('../../../../../components/Input/Input.cjs');
81
+ require('../../../../../components/OverlayCard/OverlayCard.cjs');
82
+ require('../../../../../components/MenuList/Dropdown/Dropdown.cjs');
83
+ require('../../../../../views/TransactionConfirmationView/TransactionConfirmationView.cjs');
84
+ require('../../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
85
+ require('../../../../../context/PasskeyContext/PasskeyContext.cjs');
86
+ require('../../PasskeyCard/PasskeyCard.cjs');
87
+ require('../../../../../utils/hooks/useWalletBackup/useWalletBackup.cjs');
88
+ require('../../../../../utils/hooks/useWalletBackup/types.cjs');
89
+ require('../../../../../utils/hooks/useWalletBackup/cloudProviders.cjs');
90
+ require('../../../views/CryptoComOnramp/CryptoComOnramp.cjs');
91
+ require('../../../../../context/OnrampContext/OnrampContext.cjs');
92
+ require('../../../../../../index.cjs');
93
+ require('../../../helpers/convertExchangeKeyAndProviderEnum.cjs');
94
+ require('qrcode');
95
+ require('../../../views/ManagePasskeysMfaWidgetView/ManagePasskeysMfaWidgetView.cjs');
96
+ require('../../../views/ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.cjs');
97
+ require('../../../views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
98
+ require('../../../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
99
+ require('../../../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
100
+ require('../../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
101
+ require('@hcaptcha/react-hcaptcha');
102
+ require('../../../../../views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.cjs');
103
+ require('../../../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
104
+ require('../../../../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.cjs');
105
+ require('../../../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
106
+ require('../../../../../store/state/tokenBalances.cjs');
107
+ require('../../../../../store/state/multichainBalances.cjs');
108
+ require('@dynamic-labs/store');
109
+ require('../../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
110
+ require('../../../../../components/InlineWidget/InlineWidget.cjs');
111
+ require('../../../../../components/IsBrowser/IsBrowser.cjs');
112
+ require('../../../../../components/Popper/Popper/Popper.cjs');
113
+ require('../../../../../components/Popper/PopperContext/PopperContext.cjs');
114
+
115
+ const MIDNIGHT_ADDRESS_TYPE_UNSHIELDED = 'midnight_unshielded';
116
+ const getMidnightAddressByType = (type, wallet) => { var _a, _b; return (_b = (_a = wallet === null || wallet === void 0 ? void 0 : wallet.additionalAddresses) === null || _a === void 0 ? void 0 : _a.find((addr) => addr.type === type)) === null || _b === void 0 ? void 0 : _b.address; };
117
+ const ActiveMidnightWalletAddresses = ({ menuOption, wallet, }) => {
118
+ var _a;
119
+ const { t } = reactI18next.useTranslation();
120
+ const unshieldedAddress = (_a = getMidnightAddressByType(MIDNIGHT_ADDRESS_TYPE_UNSHIELDED, wallet)) !== null && _a !== void 0 ? _a : wallet === null || wallet === void 0 ? void 0 : wallet.address;
121
+ return (jsxRuntime.jsxs("div", { className: 'active-wallet-information__address-container', children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Typography.Typography, { className: 'active-wallet-information__address', weight: 'regular', variant: 'body_small', color: 'secondary', copykey: 'dyn_active_wallet_info.midnight_unshielded_address', children: t('dyn_active_wallet_info.midnight_unshielded_address') }), jsxRuntime.jsx(Typography.Typography, { className: 'active-wallet-information__address', weight: 'medium', variant: 'body_normal', color: 'primary', children: shortenWalletAddress.shortenWalletAddress(unshieldedAddress) })] }), jsxRuntime.jsx(DotsMenu.DotsMenu, { "data-testid": 'dots-menu', options: menuOption, buttonClassName: 'active-wallet-information__dots-menu', buttonClassNameWithOpenMenu: 'active-wallet-information__dots-menu' })] }));
122
+ };
123
+
124
+ exports.ActiveMidnightWalletAddresses = ActiveMidnightWalletAddresses;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { MenuOption } from '../../../../../components';
3
+ import { Wallet } from '../../../../../shared';
4
+ type Props = {
5
+ menuOption: MenuOption[];
6
+ wallet?: Wallet;
7
+ };
8
+ export declare const ActiveMidnightWalletAddresses: ({ menuOption, wallet, }: Props) => JSX.Element;
9
+ export {};
@@ -0,0 +1,120 @@
1
+ 'use client'
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { useTranslation } from 'react-i18next';
4
+ import '../../../../../components/Accordion/components/AccordionItem/AccordionItem.js';
5
+ import 'react';
6
+ import '@dynamic-labs/iconic';
7
+ import '../../../../../context/ViewContext/ViewContext.js';
8
+ import '../../../../../../../_virtual/_tslib.js';
9
+ import '@dynamic-labs/utils';
10
+ import '@dynamic-labs/wallet-connector-core';
11
+ import '../../../../../shared/logger.js';
12
+ import '@dynamic-labs/wallet-book';
13
+ import '../../../../../utils/constants/colors.js';
14
+ import '../../../../../utils/constants/values.js';
15
+ import '@dynamic-labs/sdk-api-core';
16
+ import '../../../../../shared/consts/index.js';
17
+ import '../../../../../components/Alert/Alert.js';
18
+ import '../../../../../events/dynamicEvents.js';
19
+ import '../../../../../context/DynamicContext/DynamicContext.js';
20
+ import '../../../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
21
+ import '../../../../../store/state/authMode/authMode.js';
22
+ import '../../../../../context/CaptchaContext/CaptchaContext.js';
23
+ import '../../../../../context/ErrorContext/ErrorContext.js';
24
+ import '@dynamic-labs/multi-wallet';
25
+ import 'react-international-phone';
26
+ import '../../../../../store/state/nonce/nonce.js';
27
+ import '@dynamic-labs-sdk/client/core';
28
+ import 'eventemitter3';
29
+ import '@dynamic-labs-sdk/client';
30
+ import '../../../../../config/ApiEndpoint.js';
31
+ import '@dynamic-labs/locale';
32
+ import '../../../../../store/state/dynamicContextProps/dynamicContextProps.js';
33
+ import '../../../../../store/state/primaryWalletId/primaryWalletId.js';
34
+ import '../../../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
35
+ import '../../../../../utils/functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
36
+ import '../../../../../context/AccessDeniedContext/AccessDeniedContext.js';
37
+ import '../../../../../context/AccountExistsContext/AccountExistsContext.js';
38
+ import '../../../../../context/UserWalletsContext/UserWalletsContext.js';
39
+ import '../../../../../context/VerificationContext/VerificationContext.js';
40
+ import 'react-dom';
41
+ import '../../../../../utils/functions/compareChains/compareChains.js';
42
+ import '../../../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
43
+ import '../../../../../context/ThemeContext/ThemeContext.js';
44
+ import '../../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
45
+ import 'bs58';
46
+ import '@dynamic-labs/types';
47
+ import '../../../../../context/SocialRedirectContext/SocialRedirectContext.js';
48
+ import '../../../../../context/LoadingContext/LoadingContext.js';
49
+ import '../../../../../context/WalletContext/WalletContext.js';
50
+ import '../../../../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
51
+ import 'yup';
52
+ import '../../../../../context/MockContext/MockContext.js';
53
+ import '../../../../../views/CollectUserDataView/useFields.js';
54
+ import '../../../../../context/FieldsStateContext/FieldsStateContext.js';
55
+ import '../../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
56
+ import '@dynamic-labs/rpc-providers';
57
+ import '../../../../../store/state/walletOptions/walletOptions.js';
58
+ import { Typography } from '../../../../../components/Typography/Typography.js';
59
+ import '../../../../../context/FooterAnimationContext/index.js';
60
+ import '../../../../../components/ShadowDOM/ShadowDOM.js';
61
+ import '../../../../../components/Transition/ZoomTransition/ZoomTransition.js';
62
+ import '../../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
63
+ import '../../../../../components/Transition/OpacityTransition/OpacityTransition.js';
64
+ import '../../../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
65
+ import '../../../../../context/WalletGroupContext/WalletGroupContext.js';
66
+ import '../../DynamicWidgetHeader/DynamicWidgetHeader.js';
67
+ import 'react-focus-lock';
68
+ import { shortenWalletAddress } from '../../../../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
69
+ import '../../../context/DynamicWidgetContext.js';
70
+ import '../../../../../components/IconButton/IconButton.js';
71
+ import '../../../../../utils/hooks/useGetMfaToken/useGetMfaToken.js';
72
+ import { DotsMenu } from '../../DotsMenu/DotsMenu.js';
73
+ import 'formik';
74
+ import '../../../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
75
+ import '../../../../../store/state/sendBalances.js';
76
+ import '../../../../../components/Input/Input.js';
77
+ import '../../../../../components/OverlayCard/OverlayCard.js';
78
+ import '../../../../../components/MenuList/Dropdown/Dropdown.js';
79
+ import '../../../../../views/TransactionConfirmationView/TransactionConfirmationView.js';
80
+ import '../../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
81
+ import '../../../../../context/PasskeyContext/PasskeyContext.js';
82
+ import '../../PasskeyCard/PasskeyCard.js';
83
+ import '../../../../../utils/hooks/useWalletBackup/useWalletBackup.js';
84
+ import '../../../../../utils/hooks/useWalletBackup/types.js';
85
+ import '../../../../../utils/hooks/useWalletBackup/cloudProviders.js';
86
+ import '../../../views/CryptoComOnramp/CryptoComOnramp.js';
87
+ import '../../../../../context/OnrampContext/OnrampContext.js';
88
+ import '../../../../../../index.js';
89
+ import '../../../helpers/convertExchangeKeyAndProviderEnum.js';
90
+ import 'qrcode';
91
+ import '../../../views/ManagePasskeysMfaWidgetView/ManagePasskeysMfaWidgetView.js';
92
+ import '../../../views/ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.js';
93
+ import '../../../views/ReceiveWalletFunds/ReceiveWalletFunds.js';
94
+ import '../../../../../context/IpConfigurationContext/IpConfigurationContext.js';
95
+ import '../../../../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
96
+ import '../../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
97
+ import '@hcaptcha/react-hcaptcha';
98
+ import '../../../../../views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.js';
99
+ import '../../../../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
100
+ import '../../../../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.js';
101
+ import '../../../../../store/state/connectorsInitializing/connectorsInitializing.js';
102
+ import '../../../../../store/state/tokenBalances.js';
103
+ import '../../../../../store/state/multichainBalances.js';
104
+ import '@dynamic-labs/store';
105
+ import '../../../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
106
+ import '../../../../../components/InlineWidget/InlineWidget.js';
107
+ import '../../../../../components/IsBrowser/IsBrowser.js';
108
+ import '../../../../../components/Popper/Popper/Popper.js';
109
+ import '../../../../../components/Popper/PopperContext/PopperContext.js';
110
+
111
+ const MIDNIGHT_ADDRESS_TYPE_UNSHIELDED = 'midnight_unshielded';
112
+ const getMidnightAddressByType = (type, wallet) => { var _a, _b; return (_b = (_a = wallet === null || wallet === void 0 ? void 0 : wallet.additionalAddresses) === null || _a === void 0 ? void 0 : _a.find((addr) => addr.type === type)) === null || _b === void 0 ? void 0 : _b.address; };
113
+ const ActiveMidnightWalletAddresses = ({ menuOption, wallet, }) => {
114
+ var _a;
115
+ const { t } = useTranslation();
116
+ const unshieldedAddress = (_a = getMidnightAddressByType(MIDNIGHT_ADDRESS_TYPE_UNSHIELDED, wallet)) !== null && _a !== void 0 ? _a : wallet === null || wallet === void 0 ? void 0 : wallet.address;
117
+ return (jsxs("div", { className: 'active-wallet-information__address-container', children: [jsxs("div", { children: [jsx(Typography, { className: 'active-wallet-information__address', weight: 'regular', variant: 'body_small', color: 'secondary', copykey: 'dyn_active_wallet_info.midnight_unshielded_address', children: t('dyn_active_wallet_info.midnight_unshielded_address') }), jsx(Typography, { className: 'active-wallet-information__address', weight: 'medium', variant: 'body_normal', color: 'primary', children: shortenWalletAddress(unshieldedAddress) })] }), jsx(DotsMenu, { "data-testid": 'dots-menu', options: menuOption, buttonClassName: 'active-wallet-information__dots-menu', buttonClassNameWithOpenMenu: 'active-wallet-information__dots-menu' })] }));
118
+ };
119
+
120
+ export { ActiveMidnightWalletAddresses };
@@ -0,0 +1 @@
1
+ export { ActiveMidnightWalletAddresses } from './ActiveMidnightWalletAddresses';
@@ -127,15 +127,16 @@ require('../../../../components/Popper/Popper/Popper.cjs');
127
127
  require('../../../../components/Popper/PopperContext/PopperContext.cjs');
128
128
  var ActiveWalletBalance = require('../ActiveWalletBalance/ActiveWalletBalance.cjs');
129
129
  var WalletDetailsCard = require('../WalletDetailsCard/WalletDetailsCard.cjs');
130
+ var ActiveMidnightWalletBalance = require('../ActiveMidnightWalletBalance/ActiveMidnightWalletBalance.cjs');
130
131
  var ActiveBitcoinWalletAddresses = require('./ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.cjs');
132
+ var ActiveMidnightWalletAddresses = require('./ActiveMidnightWalletAddresses/ActiveMidnightWalletAddresses.cjs');
131
133
  var ActiveWalletAddress = require('./ActiveWalletAddress/ActiveWalletAddress.cjs');
132
134
 
133
135
  const ICON_SIZE = 32;
134
136
  const DROPDOWN_ICON_SIZE = 16;
135
137
  const ActiveWalletInformation = ({ isLoading = false, }) => {
136
- var _a, _b, _c;
138
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
137
139
  const { t } = reactI18next.useTranslation();
138
- /** Controls the [WalletDetailsCard] open state */
139
140
  const [detailsCardOpen, setDetailsCardOpen] = React.useState(false);
140
141
  const { primaryWallet, network, user, removeWallet } = useInternalDynamicContext.useInternalDynamicContext();
141
142
  const { clearStackAndPushInitialView } = ViewContext.useViewContext();
@@ -151,6 +152,7 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
151
152
  const { showAlert } = PasskeyContext.usePasskeyContext();
152
153
  const wallet = (_a = (primaryWallet && getEOAWallet(primaryWallet))) !== null && _a !== void 0 ? _a : primaryWallet;
153
154
  const isBitcoin = primaryWallet && walletConnectorCore.isBitcoinConnector(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
155
+ const isMidnight = primaryWallet && walletConnectorCore.isMidnightConnector(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
154
156
  const isWaasWallet = primaryWallet && walletConnectorCore.isDynamicWaasConnector(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
155
157
  const isEmbeddedWallet = Boolean(wallet && ((_c = (_b = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _b === void 0 ? void 0 : _b.key) === null || _c === void 0 ? void 0 : _c.startsWith('turnkey')));
156
158
  const openDetailsCard = React.useCallback(() => {
@@ -173,9 +175,13 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
173
175
  {
174
176
  Icon: (jsxRuntime.jsx(eyeOutline.ReactComponent, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE })),
175
177
  callback: openDetailsCard,
176
- copykey: 'dyn_active_wallet_info.options.view_address',
178
+ copykey: isMidnight
179
+ ? 'dyn_active_wallet_info.options.view_addresses'
180
+ : 'dyn_active_wallet_info.options.view_address',
177
181
  hide: !address,
178
- text: t('dyn_active_wallet_info.options.view_address'),
182
+ text: isMidnight
183
+ ? t('dyn_active_wallet_info.options.view_addresses')
184
+ : t('dyn_active_wallet_info.options.view_address'),
179
185
  },
180
186
  {
181
187
  Icon: (jsxRuntime.jsx(unlink.ReactComponent, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE })),
@@ -204,21 +210,26 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
204
210
  const showTestnetAlert = testnet && !isTurnkeyWalletWithoutAuthenticator;
205
211
  const shouldHideNetwork = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.hideNetworkInDynamicWidget;
206
212
  const activeWalletAddress = () => {
207
- // For Bitcoin wallets, show dual addresses (Ordinals & Payment) only if NOT a WaaS wallet
208
- // WaaS Bitcoin wallets should show a single address like other chains
209
213
  if (isBitcoin && !isWaasWallet) {
210
214
  return (jsxRuntime.jsx(ActiveBitcoinWalletAddresses.ActiveBitcoinWalletAddresses, { wallet: primaryWallet, menuOption: options }));
211
215
  }
212
- else {
213
- return (jsxRuntime.jsx(ActiveWalletAddress.ActiveWalletAddress, { wallet: primaryWallet, nameServiceName: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || (user === null || user === void 0 ? void 0 : user.email), menuOption: options, isLoading: isLoading, fullWidth: shouldHideNetwork, addressTypeLabel: getWaasAddressTypeLabel.getWaasAddressTypeLabel((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.chain) || (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.connectedChain), Boolean(isWaasWallet), address) }));
216
+ if (isMidnight) {
217
+ return (jsxRuntime.jsx(ActiveMidnightWalletAddresses.ActiveMidnightWalletAddresses, { wallet: primaryWallet, menuOption: options }));
214
218
  }
219
+ return (jsxRuntime.jsx(ActiveWalletAddress.ActiveWalletAddress, { wallet: primaryWallet, nameServiceName: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || (user === null || user === void 0 ? void 0 : user.email), menuOption: options, isLoading: isLoading, fullWidth: shouldHideNetwork, addressTypeLabel: getWaasAddressTypeLabel.getWaasAddressTypeLabel((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.chain) || (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.connectedChain), Boolean(isWaasWallet), address) }));
215
220
  };
216
221
  if (isLoading) {
217
- return (jsxRuntime.jsxs("div", { className: 'active-wallet-information-container active-wallet-information-container--loading', "data-testid": 'active-wallet-information', children: [jsxRuntime.jsx("div", { className: 'active-wallet-information active-wallet-information--loading', children: jsxRuntime.jsxs("div", { className: 'active-wallet-information__header', children: [jsxRuntime.jsx("div", { className: 'active-wallet-information__avatar', children: jsxRuntime.jsx("div", { className: 'active-wallet-information__wallet-img', children: jsxRuntime.jsx(Skeleton.Skeleton, { className: 'active-wallet-information__skeleton-avatar' }) }) }), jsxRuntime.jsxs("div", { className: 'active-wallet-information__details', children: [jsxRuntime.jsxs("div", { className: 'active-wallet-information__addresses-container active-wallet-information__addresses-container--loading', children: [jsxRuntime.jsx("div", { className: 'active-wallet-information__handle-row', children: jsxRuntime.jsx(Skeleton.Skeleton, { className: 'active-wallet-information__skeleton-handle' }) }), jsxRuntime.jsx("div", { className: 'active-wallet-information__handle-row', children: jsxRuntime.jsx(Skeleton.Skeleton, { className: 'active-wallet-information__skeleton-address' }) })] }), !shouldHideNetwork && (jsxRuntime.jsx("div", { className: 'active-wallet-information__network-picker', children: jsxRuntime.jsx(Skeleton.Skeleton, { className: 'active-wallet-information__skeleton-network' }) }))] })] }) }), jsxRuntime.jsx(ActiveWalletBalance.ActiveWalletBalance, { isLoading: isLoading })] }));
222
+ return (jsxRuntime.jsxs("div", { className: 'active-wallet-information-container active-wallet-information-container--loading', "data-testid": 'active-wallet-information', children: [jsxRuntime.jsx("div", { className: 'active-wallet-information active-wallet-information--loading', children: jsxRuntime.jsxs("div", { className: 'active-wallet-information__header', children: [jsxRuntime.jsx("div", { className: 'active-wallet-information__avatar', children: jsxRuntime.jsx("div", { className: 'active-wallet-information__wallet-img', children: jsxRuntime.jsx(Skeleton.Skeleton, { className: 'active-wallet-information__skeleton-avatar' }) }) }), jsxRuntime.jsxs("div", { className: 'active-wallet-information__details', children: [jsxRuntime.jsxs("div", { className: 'active-wallet-information__addresses-container active-wallet-information__addresses-container--loading', children: [jsxRuntime.jsx("div", { className: 'active-wallet-information__handle-row', children: jsxRuntime.jsx(Skeleton.Skeleton, { className: 'active-wallet-information__skeleton-handle' }) }), jsxRuntime.jsx("div", { className: 'active-wallet-information__handle-row', children: jsxRuntime.jsx(Skeleton.Skeleton, { className: 'active-wallet-information__skeleton-address' }) })] }), !shouldHideNetwork && (jsxRuntime.jsx("div", { className: 'active-wallet-information__network-picker', children: jsxRuntime.jsx(Skeleton.Skeleton, { className: 'active-wallet-information__skeleton-network' }) }))] })] }) }), isMidnight ? (jsxRuntime.jsx(ActiveMidnightWalletBalance.ActiveMidnightWalletBalance, { isLoading: isLoading })) : (jsxRuntime.jsx(ActiveWalletBalance.ActiveWalletBalance, { isLoading: isLoading }))] }));
218
223
  }
219
224
  return (jsxRuntime.jsxs("div", { className: 'active-wallet-information-container', "data-testid": 'active-wallet-information', children: [jsxRuntime.jsxs("div", { className: 'active-wallet-information', children: [jsxRuntime.jsxs("div", { className: 'active-wallet-information__header', children: [jsxRuntime.jsx("div", { className: 'active-wallet-information__avatar', children: (nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsxRuntime.jsx("div", { className: 'active-wallet-information__avatar__name-service', children: jsxRuntime.jsx("img", { src: nameService === null || nameService === void 0 ? void 0 : nameService.avatar, alt: '' }) })) : (jsxRuntime.jsx("div", { className: 'active-wallet-information__wallet-img', children: jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon, { iconSize: ICON_SIZE }) })) }), jsxRuntime.jsxs("div", { className: 'active-wallet-information__details', children: [jsxRuntime.jsx("div", { className: classNames.classNames('active-wallet-information__addresses-container', {
220
225
  'active-wallet-information__addresses-container--centered': !(nameService === null || nameService === void 0 ? void 0 : nameService.name),
221
- }), children: activeWalletAddress() }), address && (jsxRuntime.jsx(WalletDetailsCard.WalletDetailsCard, { open: detailsCardOpen, address: address, onClose: () => setDetailsCardOpen(false) })), !shouldHideNetwork && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, mainClassName: 'active-wallet-information__network-picker', buttonClassName: 'active-wallet-information__network-picker-button', showNetworkName: true, isLoading: isLoading }))] })] }), headerAlert && (jsxRuntime.jsx(Alert.Alert, { variant: headerAlert.variant, children: headerAlert.content })), showTestnetAlert && (jsxRuntime.jsx(Alert.Alert, { variant: 'warning', copykey: 'dyn_active_wallet_info.testnet_warning', children: t('dyn_active_wallet_info.testnet_warning') }))] }), jsxRuntime.jsx(ActiveWalletBalance.ActiveWalletBalance, {})] }));
226
+ }), children: activeWalletAddress() }), address && (jsxRuntime.jsx(WalletDetailsCard.WalletDetailsCard, { open: detailsCardOpen, address: address, onClose: () => setDetailsCardOpen(false), midnightAddresses: isMidnight
227
+ ? {
228
+ dust: (_e = (_d = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.additionalAddresses) === null || _d === void 0 ? void 0 : _d.find((a) => a.type === 'midnight_dust')) === null || _e === void 0 ? void 0 : _e.address,
229
+ shielded: (_g = (_f = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.additionalAddresses) === null || _f === void 0 ? void 0 : _f.find((a) => a.type === 'midnight_shielded')) === null || _g === void 0 ? void 0 : _g.address,
230
+ unshielded: (_k = (_j = (_h = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.additionalAddresses) === null || _h === void 0 ? void 0 : _h.find((a) => a.type === 'midnight_unshielded')) === null || _j === void 0 ? void 0 : _j.address) !== null && _k !== void 0 ? _k : address,
231
+ }
232
+ : undefined })), !shouldHideNetwork && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, mainClassName: 'active-wallet-information__network-picker', buttonClassName: 'active-wallet-information__network-picker-button', showNetworkName: true, isLoading: isLoading }))] })] }), headerAlert && (jsxRuntime.jsx(Alert.Alert, { variant: headerAlert.variant, children: headerAlert.content })), showTestnetAlert && (jsxRuntime.jsx(Alert.Alert, { variant: 'warning', copykey: 'dyn_active_wallet_info.testnet_warning', children: t('dyn_active_wallet_info.testnet_warning') }))] }), isMidnight ? jsxRuntime.jsx(ActiveMidnightWalletBalance.ActiveMidnightWalletBalance, {}) : jsxRuntime.jsx(ActiveWalletBalance.ActiveWalletBalance, {})] }));
222
233
  };
223
234
 
224
235
  exports.ActiveWalletInformation = ActiveWalletInformation;
@@ -3,7 +3,7 @@ import { __awaiter } from '../../../../../../_virtual/_tslib.js';
3
3
  import { jsx, jsxs } from 'react/jsx-runtime';
4
4
  import { useState, useCallback } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
- import { isBitcoinConnector, isDynamicWaasConnector } from '@dynamic-labs/wallet-connector-core';
6
+ import { isBitcoinConnector, isMidnightConnector, isDynamicWaasConnector } from '@dynamic-labs/wallet-connector-core';
7
7
  import '../../../../components/Accordion/components/AccordionItem/AccordionItem.js';
8
8
  import { ReactComponent as SvgCopy } from '../../../../shared/assets/copy.js';
9
9
  import { ReactComponent as SvgEyeOutline } from '../../../../shared/assets/eye-outline.js';
@@ -123,15 +123,16 @@ import '../../../../components/Popper/Popper/Popper.js';
123
123
  import '../../../../components/Popper/PopperContext/PopperContext.js';
124
124
  import { ActiveWalletBalance } from '../ActiveWalletBalance/ActiveWalletBalance.js';
125
125
  import { WalletDetailsCard } from '../WalletDetailsCard/WalletDetailsCard.js';
126
+ import { ActiveMidnightWalletBalance } from '../ActiveMidnightWalletBalance/ActiveMidnightWalletBalance.js';
126
127
  import { ActiveBitcoinWalletAddresses } from './ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.js';
128
+ import { ActiveMidnightWalletAddresses } from './ActiveMidnightWalletAddresses/ActiveMidnightWalletAddresses.js';
127
129
  import { ActiveWalletAddress } from './ActiveWalletAddress/ActiveWalletAddress.js';
128
130
 
129
131
  const ICON_SIZE = 32;
130
132
  const DROPDOWN_ICON_SIZE = 16;
131
133
  const ActiveWalletInformation = ({ isLoading = false, }) => {
132
- var _a, _b, _c;
134
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
133
135
  const { t } = useTranslation();
134
- /** Controls the [WalletDetailsCard] open state */
135
136
  const [detailsCardOpen, setDetailsCardOpen] = useState(false);
136
137
  const { primaryWallet, network, user, removeWallet } = useInternalDynamicContext();
137
138
  const { clearStackAndPushInitialView } = useViewContext();
@@ -147,6 +148,7 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
147
148
  const { showAlert } = usePasskeyContext();
148
149
  const wallet = (_a = (primaryWallet && getEOAWallet(primaryWallet))) !== null && _a !== void 0 ? _a : primaryWallet;
149
150
  const isBitcoin = primaryWallet && isBitcoinConnector(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
151
+ const isMidnight = primaryWallet && isMidnightConnector(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
150
152
  const isWaasWallet = primaryWallet && isDynamicWaasConnector(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
151
153
  const isEmbeddedWallet = Boolean(wallet && ((_c = (_b = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _b === void 0 ? void 0 : _b.key) === null || _c === void 0 ? void 0 : _c.startsWith('turnkey')));
152
154
  const openDetailsCard = useCallback(() => {
@@ -169,9 +171,13 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
169
171
  {
170
172
  Icon: (jsx(SvgEyeOutline, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE })),
171
173
  callback: openDetailsCard,
172
- copykey: 'dyn_active_wallet_info.options.view_address',
174
+ copykey: isMidnight
175
+ ? 'dyn_active_wallet_info.options.view_addresses'
176
+ : 'dyn_active_wallet_info.options.view_address',
173
177
  hide: !address,
174
- text: t('dyn_active_wallet_info.options.view_address'),
178
+ text: isMidnight
179
+ ? t('dyn_active_wallet_info.options.view_addresses')
180
+ : t('dyn_active_wallet_info.options.view_address'),
175
181
  },
176
182
  {
177
183
  Icon: (jsx(SvgUnlink, { width: DROPDOWN_ICON_SIZE, height: DROPDOWN_ICON_SIZE })),
@@ -200,21 +206,26 @@ const ActiveWalletInformation = ({ isLoading = false, }) => {
200
206
  const showTestnetAlert = testnet && !isTurnkeyWalletWithoutAuthenticator;
201
207
  const shouldHideNetwork = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.hideNetworkInDynamicWidget;
202
208
  const activeWalletAddress = () => {
203
- // For Bitcoin wallets, show dual addresses (Ordinals & Payment) only if NOT a WaaS wallet
204
- // WaaS Bitcoin wallets should show a single address like other chains
205
209
  if (isBitcoin && !isWaasWallet) {
206
210
  return (jsx(ActiveBitcoinWalletAddresses, { wallet: primaryWallet, menuOption: options }));
207
211
  }
208
- else {
209
- return (jsx(ActiveWalletAddress, { wallet: primaryWallet, nameServiceName: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || (user === null || user === void 0 ? void 0 : user.email), menuOption: options, isLoading: isLoading, fullWidth: shouldHideNetwork, addressTypeLabel: getWaasAddressTypeLabel((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.chain) || (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.connectedChain), Boolean(isWaasWallet), address) }));
212
+ if (isMidnight) {
213
+ return (jsx(ActiveMidnightWalletAddresses, { wallet: primaryWallet, menuOption: options }));
210
214
  }
215
+ return (jsx(ActiveWalletAddress, { wallet: primaryWallet, nameServiceName: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || (user === null || user === void 0 ? void 0 : user.email), menuOption: options, isLoading: isLoading, fullWidth: shouldHideNetwork, addressTypeLabel: getWaasAddressTypeLabel((primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.chain) || (primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.connectedChain), Boolean(isWaasWallet), address) }));
211
216
  };
212
217
  if (isLoading) {
213
- return (jsxs("div", { className: 'active-wallet-information-container active-wallet-information-container--loading', "data-testid": 'active-wallet-information', children: [jsx("div", { className: 'active-wallet-information active-wallet-information--loading', children: jsxs("div", { className: 'active-wallet-information__header', children: [jsx("div", { className: 'active-wallet-information__avatar', children: jsx("div", { className: 'active-wallet-information__wallet-img', children: jsx(Skeleton, { className: 'active-wallet-information__skeleton-avatar' }) }) }), jsxs("div", { className: 'active-wallet-information__details', children: [jsxs("div", { className: 'active-wallet-information__addresses-container active-wallet-information__addresses-container--loading', children: [jsx("div", { className: 'active-wallet-information__handle-row', children: jsx(Skeleton, { className: 'active-wallet-information__skeleton-handle' }) }), jsx("div", { className: 'active-wallet-information__handle-row', children: jsx(Skeleton, { className: 'active-wallet-information__skeleton-address' }) })] }), !shouldHideNetwork && (jsx("div", { className: 'active-wallet-information__network-picker', children: jsx(Skeleton, { className: 'active-wallet-information__skeleton-network' }) }))] })] }) }), jsx(ActiveWalletBalance, { isLoading: isLoading })] }));
218
+ return (jsxs("div", { className: 'active-wallet-information-container active-wallet-information-container--loading', "data-testid": 'active-wallet-information', children: [jsx("div", { className: 'active-wallet-information active-wallet-information--loading', children: jsxs("div", { className: 'active-wallet-information__header', children: [jsx("div", { className: 'active-wallet-information__avatar', children: jsx("div", { className: 'active-wallet-information__wallet-img', children: jsx(Skeleton, { className: 'active-wallet-information__skeleton-avatar' }) }) }), jsxs("div", { className: 'active-wallet-information__details', children: [jsxs("div", { className: 'active-wallet-information__addresses-container active-wallet-information__addresses-container--loading', children: [jsx("div", { className: 'active-wallet-information__handle-row', children: jsx(Skeleton, { className: 'active-wallet-information__skeleton-handle' }) }), jsx("div", { className: 'active-wallet-information__handle-row', children: jsx(Skeleton, { className: 'active-wallet-information__skeleton-address' }) })] }), !shouldHideNetwork && (jsx("div", { className: 'active-wallet-information__network-picker', children: jsx(Skeleton, { className: 'active-wallet-information__skeleton-network' }) }))] })] }) }), isMidnight ? (jsx(ActiveMidnightWalletBalance, { isLoading: isLoading })) : (jsx(ActiveWalletBalance, { isLoading: isLoading }))] }));
214
219
  }
215
220
  return (jsxs("div", { className: 'active-wallet-information-container', "data-testid": 'active-wallet-information', children: [jsxs("div", { className: 'active-wallet-information', children: [jsxs("div", { className: 'active-wallet-information__header', children: [jsx("div", { className: 'active-wallet-information__avatar', children: (nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsx("div", { className: 'active-wallet-information__avatar__name-service', children: jsx("img", { src: nameService === null || nameService === void 0 ? void 0 : nameService.avatar, alt: '' }) })) : (jsx("div", { className: 'active-wallet-information__wallet-img', children: jsx(AuthProviderIcon, { iconSize: ICON_SIZE }) })) }), jsxs("div", { className: 'active-wallet-information__details', children: [jsx("div", { className: classNames('active-wallet-information__addresses-container', {
216
221
  'active-wallet-information__addresses-container--centered': !(nameService === null || nameService === void 0 ? void 0 : nameService.name),
217
- }), children: activeWalletAddress() }), address && (jsx(WalletDetailsCard, { open: detailsCardOpen, address: address, onClose: () => setDetailsCardOpen(false) })), !shouldHideNetwork && (jsx(NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, mainClassName: 'active-wallet-information__network-picker', buttonClassName: 'active-wallet-information__network-picker-button', showNetworkName: true, isLoading: isLoading }))] })] }), headerAlert && (jsx(Alert, { variant: headerAlert.variant, children: headerAlert.content })), showTestnetAlert && (jsx(Alert, { variant: 'warning', copykey: 'dyn_active_wallet_info.testnet_warning', children: t('dyn_active_wallet_info.testnet_warning') }))] }), jsx(ActiveWalletBalance, {})] }));
222
+ }), children: activeWalletAddress() }), address && (jsx(WalletDetailsCard, { open: detailsCardOpen, address: address, onClose: () => setDetailsCardOpen(false), midnightAddresses: isMidnight
223
+ ? {
224
+ dust: (_e = (_d = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.additionalAddresses) === null || _d === void 0 ? void 0 : _d.find((a) => a.type === 'midnight_dust')) === null || _e === void 0 ? void 0 : _e.address,
225
+ shielded: (_g = (_f = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.additionalAddresses) === null || _f === void 0 ? void 0 : _f.find((a) => a.type === 'midnight_shielded')) === null || _g === void 0 ? void 0 : _g.address,
226
+ unshielded: (_k = (_j = (_h = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.additionalAddresses) === null || _h === void 0 ? void 0 : _h.find((a) => a.type === 'midnight_unshielded')) === null || _j === void 0 ? void 0 : _j.address) !== null && _k !== void 0 ? _k : address,
227
+ }
228
+ : undefined })), !shouldHideNetwork && (jsx(NetworkPicker, { currentNetwork: network, connector: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, mainClassName: 'active-wallet-information__network-picker', buttonClassName: 'active-wallet-information__network-picker-button', showNetworkName: true, isLoading: isLoading }))] })] }), headerAlert && (jsx(Alert, { variant: headerAlert.variant, children: headerAlert.content })), showTestnetAlert && (jsx(Alert, { variant: 'warning', copykey: 'dyn_active_wallet_info.testnet_warning', children: t('dyn_active_wallet_info.testnet_warning') }))] }), isMidnight ? jsx(ActiveMidnightWalletBalance, {}) : jsx(ActiveWalletBalance, {})] }));
218
229
  };
219
230
 
220
231
  export { ActiveWalletInformation };
@@ -71,6 +71,7 @@ require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
71
71
  require('../DynamicWidgetHeader/DynamicWidgetHeader.cjs');
72
72
  require('react-focus-lock');
73
73
  var Icon = require('../../../../components/Icon/Icon.cjs');
74
+ var shortenWalletAddress = require('../../../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
74
75
  require('../../context/DynamicWidgetContext.cjs');
75
76
  require('../../../../components/IconButton/IconButton.cjs');
76
77
  require('../../../../utils/hooks/useGetMfaToken/useGetMfaToken.cjs');
@@ -113,11 +114,30 @@ require('../../../../components/IsBrowser/IsBrowser.cjs');
113
114
  require('../../../../components/Popper/Popper/Popper.cjs');
114
115
  require('../../../../components/Popper/PopperContext/PopperContext.cjs');
115
116
 
117
+ const MIDNIGHT_ADDRESS_ROWS = [
118
+ {
119
+ field: 'unshielded',
120
+ key: 'dyn_active_wallet_info.midnight_unshielded_address',
121
+ },
122
+ {
123
+ field: 'shielded',
124
+ key: 'dyn_active_wallet_info.midnight_shielded_address',
125
+ },
126
+ {
127
+ field: 'dust',
128
+ key: 'dyn_active_wallet_info.midnight_dust_address',
129
+ },
130
+ ];
116
131
  /** Component for wallet detail overlays */
117
- const WalletDetailsCard = ({ address, open, onClose, }) => {
132
+ const WalletDetailsCard = ({ address, open, onClose, midnightAddresses, }) => {
118
133
  const { t } = reactI18next.useTranslation();
119
134
  const copyIcon = (jsxRuntime.jsx(Icon.Icon, { size: 'small', color: 'text-secondary', children: jsxRuntime.jsx(copy.ReactComponent, {}) }));
120
- return (jsxRuntime.jsxs(OverlayCard.OverlayCard, { isOpen: open, onClose: onClose, children: [jsxRuntime.jsx(OverlayCard.OverlayCard.Header, { children: t('dyn_wallet_details_card.header') }), jsxRuntime.jsxs(OverlayCard.OverlayCard.Content, { className: 'wallet-details-card__body', children: [jsxRuntime.jsx(Typography.Typography, { className: 'wallet-details-card__text', color: 'primary', weight: 'bold', variant: 'body_small', copykey: 'dyn_wallet_details_card.address', children: t('dyn_wallet_details_card.address') }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-details-card__text', color: 'secondary', weight: 'regular', variant: 'body_small', children: address }), jsxRuntime.jsx(CopyButton.CopyButton, { textToCopy: address, variant: 'button', startSlot: copyIcon, children: t('dyn_wallet_details_card.copy') })] })] }));
135
+ return (jsxRuntime.jsxs(OverlayCard.OverlayCard, { isOpen: open, onClose: onClose, children: [jsxRuntime.jsx(OverlayCard.OverlayCard.Header, { children: t('dyn_wallet_details_card.header') }), jsxRuntime.jsx(OverlayCard.OverlayCard.Content, { className: 'wallet-details-card__body', children: midnightAddresses ? (MIDNIGHT_ADDRESS_ROWS.map(({ key, field }) => {
136
+ const addr = midnightAddresses[field];
137
+ if (!addr)
138
+ return null;
139
+ return (jsxRuntime.jsxs("div", { className: 'wallet-details-card__address-block', children: [jsxRuntime.jsx(Typography.Typography, { className: 'wallet-details-card__text', color: 'primary', weight: 'bold', variant: 'body_small', copykey: key, children: t(key) }), jsxRuntime.jsxs("div", { className: 'wallet-details-card__address-row', children: [jsxRuntime.jsx(Typography.Typography, { className: 'wallet-details-card__text', color: 'secondary', weight: 'regular', variant: 'body_small', children: shortenWalletAddress.shortenWalletAddress(addr) }), jsxRuntime.jsx(CopyButton.CopyButton, { textToCopy: addr, children: copyIcon })] })] }, field));
140
+ })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, { className: 'wallet-details-card__text', color: 'primary', weight: 'bold', variant: 'body_small', copykey: 'dyn_wallet_details_card.address', children: t('dyn_wallet_details_card.address') }), jsxRuntime.jsx(Typography.Typography, { className: 'wallet-details-card__text', color: 'secondary', weight: 'regular', variant: 'body_small', children: address }), jsxRuntime.jsx(CopyButton.CopyButton, { textToCopy: address, variant: 'button', startSlot: copyIcon, children: t('dyn_wallet_details_card.copy') })] })) })] }));
121
141
  };
122
142
 
123
143
  exports.WalletDetailsCard = WalletDetailsCard;
@@ -1,4 +1,9 @@
1
1
  /// <reference types="react" />
2
+ type MidnightAddresses = {
3
+ unshielded?: string;
4
+ shielded?: string;
5
+ dust?: string;
6
+ };
2
7
  type WalletDetailsCardProps = {
3
8
  /** String representation of a wallet address */
4
9
  address: string;
@@ -6,7 +11,9 @@ type WalletDetailsCardProps = {
6
11
  open: boolean;
7
12
  /** Callback when the overlay is closed */
8
13
  onClose: VoidFunction;
14
+ /** When provided, renders separate Midnight address rows instead of a single address */
15
+ midnightAddresses?: MidnightAddresses;
9
16
  };
10
17
  /** Component for wallet detail overlays */
11
- export declare const WalletDetailsCard: ({ address, open, onClose, }: WalletDetailsCardProps) => JSX.Element;
18
+ export declare const WalletDetailsCard: ({ address, open, onClose, midnightAddresses, }: WalletDetailsCardProps) => JSX.Element;
12
19
  export {};
@@ -1,5 +1,5 @@
1
1
  'use client'
2
- import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import '../../../../components/Accordion/components/AccordionItem/AccordionItem.js';
5
5
  import 'react';
@@ -67,6 +67,7 @@ import '../../../../context/WalletGroupContext/WalletGroupContext.js';
67
67
  import '../DynamicWidgetHeader/DynamicWidgetHeader.js';
68
68
  import 'react-focus-lock';
69
69
  import { Icon } from '../../../../components/Icon/Icon.js';
70
+ import { shortenWalletAddress } from '../../../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
70
71
  import '../../context/DynamicWidgetContext.js';
71
72
  import '../../../../components/IconButton/IconButton.js';
72
73
  import '../../../../utils/hooks/useGetMfaToken/useGetMfaToken.js';
@@ -109,11 +110,30 @@ import '../../../../components/IsBrowser/IsBrowser.js';
109
110
  import '../../../../components/Popper/Popper/Popper.js';
110
111
  import '../../../../components/Popper/PopperContext/PopperContext.js';
111
112
 
113
+ const MIDNIGHT_ADDRESS_ROWS = [
114
+ {
115
+ field: 'unshielded',
116
+ key: 'dyn_active_wallet_info.midnight_unshielded_address',
117
+ },
118
+ {
119
+ field: 'shielded',
120
+ key: 'dyn_active_wallet_info.midnight_shielded_address',
121
+ },
122
+ {
123
+ field: 'dust',
124
+ key: 'dyn_active_wallet_info.midnight_dust_address',
125
+ },
126
+ ];
112
127
  /** Component for wallet detail overlays */
113
- const WalletDetailsCard = ({ address, open, onClose, }) => {
128
+ const WalletDetailsCard = ({ address, open, onClose, midnightAddresses, }) => {
114
129
  const { t } = useTranslation();
115
130
  const copyIcon = (jsx(Icon, { size: 'small', color: 'text-secondary', children: jsx(SvgCopy, {}) }));
116
- return (jsxs(OverlayCard, { isOpen: open, onClose: onClose, children: [jsx(OverlayCard.Header, { children: t('dyn_wallet_details_card.header') }), jsxs(OverlayCard.Content, { className: 'wallet-details-card__body', children: [jsx(Typography, { className: 'wallet-details-card__text', color: 'primary', weight: 'bold', variant: 'body_small', copykey: 'dyn_wallet_details_card.address', children: t('dyn_wallet_details_card.address') }), jsx(Typography, { className: 'wallet-details-card__text', color: 'secondary', weight: 'regular', variant: 'body_small', children: address }), jsx(CopyButton, { textToCopy: address, variant: 'button', startSlot: copyIcon, children: t('dyn_wallet_details_card.copy') })] })] }));
131
+ return (jsxs(OverlayCard, { isOpen: open, onClose: onClose, children: [jsx(OverlayCard.Header, { children: t('dyn_wallet_details_card.header') }), jsx(OverlayCard.Content, { className: 'wallet-details-card__body', children: midnightAddresses ? (MIDNIGHT_ADDRESS_ROWS.map(({ key, field }) => {
132
+ const addr = midnightAddresses[field];
133
+ if (!addr)
134
+ return null;
135
+ return (jsxs("div", { className: 'wallet-details-card__address-block', children: [jsx(Typography, { className: 'wallet-details-card__text', color: 'primary', weight: 'bold', variant: 'body_small', copykey: key, children: t(key) }), jsxs("div", { className: 'wallet-details-card__address-row', children: [jsx(Typography, { className: 'wallet-details-card__text', color: 'secondary', weight: 'regular', variant: 'body_small', children: shortenWalletAddress(addr) }), jsx(CopyButton, { textToCopy: addr, children: copyIcon })] })] }, field));
136
+ })) : (jsxs(Fragment, { children: [jsx(Typography, { className: 'wallet-details-card__text', color: 'primary', weight: 'bold', variant: 'body_small', copykey: 'dyn_wallet_details_card.address', children: t('dyn_wallet_details_card.address') }), jsx(Typography, { className: 'wallet-details-card__text', color: 'secondary', weight: 'regular', variant: 'body_small', children: address }), jsx(CopyButton, { textToCopy: address, variant: 'button', startSlot: copyIcon, children: t('dyn_wallet_details_card.copy') })] })) })] }));
117
137
  };
118
138
 
119
139
  export { WalletDetailsCard };