@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.
- package/CHANGELOG.md +24 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +13 -13
- package/src/lib/data/api/aleo/getAleoCuratedPrices.cjs +73 -0
- package/src/lib/data/api/aleo/getAleoCuratedPrices.d.ts +38 -0
- package/src/lib/data/api/aleo/getAleoCuratedPrices.js +69 -0
- package/src/lib/shared/assets/index.d.ts +2 -0
- package/src/lib/shared/assets/midnight-shielded.cjs +54 -0
- package/src/lib/shared/assets/midnight-shielded.js +30 -0
- package/src/lib/shared/assets/midnight-unshielded.cjs +54 -0
- package/src/lib/shared/assets/midnight-unshielded.js +30 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/compareChains/compareChains.cjs +1 -0
- package/src/lib/utils/functions/compareChains/compareChains.js +1 -0
- package/src/lib/utils/functions/getTransactionLink/blockExplorerPatterns.cjs +12 -0
- package/src/lib/utils/functions/getTransactionLink/blockExplorerPatterns.js +12 -0
- package/src/lib/utils/hooks/useAleoAutoMergeRecords/index.d.ts +1 -0
- package/src/lib/utils/hooks/useAleoAutoMergeRecords/useAleoAutoMergeRecords.cjs +246 -0
- package/src/lib/utils/hooks/useAleoAutoMergeRecords/useAleoAutoMergeRecords.d.ts +17 -0
- package/src/lib/utils/hooks/useAleoAutoMergeRecords/useAleoAutoMergeRecords.js +242 -0
- package/src/lib/utils/hooks/useAleoAutoShieldSponsoredTokens/index.d.ts +1 -0
- package/src/lib/utils/hooks/useAleoAutoShieldSponsoredTokens/useAleoAutoShieldSponsoredTokens.cjs +263 -0
- package/src/lib/utils/hooks/useAleoAutoShieldSponsoredTokens/useAleoAutoShieldSponsoredTokens.d.ts +59 -0
- package/src/lib/utils/hooks/useAleoAutoShieldSponsoredTokens/useAleoAutoShieldSponsoredTokens.js +259 -0
- package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.cjs +139 -68
- package/src/lib/utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.js +139 -68
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.cjs +12 -1
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.js +12 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveMidnightWalletBalance/ActiveMidnightWalletBalance.cjs +193 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveMidnightWalletBalance/ActiveMidnightWalletBalance.d.ts +7 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveMidnightWalletBalance/ActiveMidnightWalletBalance.js +189 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveMidnightWalletBalance/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.cjs +26 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.js +26 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveMidnightWalletAddresses/ActiveMidnightWalletAddresses.cjs +124 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveMidnightWalletAddresses/ActiveMidnightWalletAddresses.d.ts +9 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveMidnightWalletAddresses/ActiveMidnightWalletAddresses.js +120 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveMidnightWalletAddresses/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +21 -10
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +22 -11
- package/src/lib/widgets/DynamicWidget/components/WalletDetailsCard/WalletDetailsCard.cjs +22 -2
- package/src/lib/widgets/DynamicWidget/components/WalletDetailsCard/WalletDetailsCard.d.ts +8 -1
- package/src/lib/widgets/DynamicWidget/components/WalletDetailsCard/WalletDetailsCard.js +23 -3
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
var React = require('react');
|
|
9
|
+
var reactI18next = require('react-i18next');
|
|
10
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
11
|
+
var Skeleton = require('../../../../components/Skeleton/Skeleton.cjs');
|
|
12
|
+
require('../../../../context/DynamicContext/DynamicContext.cjs');
|
|
13
|
+
require('../../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
14
|
+
require('@dynamic-labs/iconic');
|
|
15
|
+
var midnightShielded = require('../../../../shared/assets/midnight-shielded.cjs');
|
|
16
|
+
var midnightUnshielded = require('../../../../shared/assets/midnight-unshielded.cjs');
|
|
17
|
+
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
18
|
+
require('../../../../shared/logger.cjs');
|
|
19
|
+
require('@dynamic-labs/wallet-book');
|
|
20
|
+
require('@dynamic-labs/utils');
|
|
21
|
+
require('../../../../utils/constants/colors.cjs');
|
|
22
|
+
require('../../../../utils/constants/values.cjs');
|
|
23
|
+
require('@dynamic-labs/sdk-api-core');
|
|
24
|
+
require('../../../../shared/consts/index.cjs');
|
|
25
|
+
require('../../../../events/dynamicEvents.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('../../../../store/state/authMode/authMode.cjs');
|
|
44
|
+
require('../../../../context/VerificationContext/VerificationContext.cjs');
|
|
45
|
+
require('react-dom');
|
|
46
|
+
require('../../../../utils/functions/compareChains/compareChains.cjs');
|
|
47
|
+
require('../../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
|
|
48
|
+
require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
49
|
+
require('../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
|
|
50
|
+
require('bs58');
|
|
51
|
+
var usePromise = require('../../../../utils/hooks/usePromise/usePromise.cjs');
|
|
52
|
+
require('@dynamic-labs/types');
|
|
53
|
+
require('../../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
54
|
+
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
55
|
+
require('../../../../context/WalletContext/WalletContext.cjs');
|
|
56
|
+
require('../../../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
57
|
+
require('yup');
|
|
58
|
+
require('../../../../context/MockContext/MockContext.cjs');
|
|
59
|
+
require('../../../../views/CollectUserDataView/useFields.cjs');
|
|
60
|
+
require('../../../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
61
|
+
require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
62
|
+
require('@dynamic-labs/rpc-providers');
|
|
63
|
+
require('../../../../store/state/walletOptions/walletOptions.cjs');
|
|
64
|
+
require('../../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
65
|
+
var classNames = require('../../../../utils/functions/classNames/classNames.cjs');
|
|
66
|
+
require('../../../../components/Alert/Alert.cjs');
|
|
67
|
+
require('../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
68
|
+
require('../../../../components/IconButton/IconButton.cjs');
|
|
69
|
+
require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
70
|
+
require('../../../../components/Input/Input.cjs');
|
|
71
|
+
require('../../../../components/IsBrowser/IsBrowser.cjs');
|
|
72
|
+
require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
73
|
+
require('../../../../components/OverlayCard/OverlayCard.cjs');
|
|
74
|
+
require('../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
75
|
+
require('../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
76
|
+
require('../../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
77
|
+
require('../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
78
|
+
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
79
|
+
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
80
|
+
require('react-focus-lock');
|
|
81
|
+
require('qrcode');
|
|
82
|
+
require('formik');
|
|
83
|
+
require('../../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
|
|
84
|
+
require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
85
|
+
require('../../context/DynamicWidgetContext.cjs');
|
|
86
|
+
require('../../../../utils/hooks/useGetMfaToken/useGetMfaToken.cjs');
|
|
87
|
+
require('../../../../utils/hooks/useWalletBackup/useWalletBackup.cjs');
|
|
88
|
+
require('../../../../utils/hooks/useWalletBackup/types.cjs');
|
|
89
|
+
require('../../../../utils/hooks/useWalletBackup/cloudProviders.cjs');
|
|
90
|
+
require('../../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
91
|
+
require('../../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
92
|
+
require('../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
93
|
+
require('@hcaptcha/react-hcaptcha');
|
|
94
|
+
require('../../helpers/convertExchangeKeyAndProviderEnum.cjs');
|
|
95
|
+
require('../../../../views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.cjs');
|
|
96
|
+
require('../../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
97
|
+
require('../../../../context/FooterAnimationContext/index.cjs');
|
|
98
|
+
require('../../../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.cjs');
|
|
99
|
+
require('../../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
100
|
+
require('../../../../context/OnrampContext/OnrampContext.cjs');
|
|
101
|
+
require('../../../../store/state/sendBalances.cjs');
|
|
102
|
+
require('../../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
103
|
+
require('../../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
104
|
+
require('../DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
105
|
+
require('../../../../views/TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
106
|
+
require('../PasskeyCard/PasskeyCard.cjs');
|
|
107
|
+
require('../../views/CryptoComOnramp/CryptoComOnramp.cjs');
|
|
108
|
+
require('../../../../../index.cjs');
|
|
109
|
+
require('../../views/ManagePasskeysMfaWidgetView/ManagePasskeysMfaWidgetView.cjs');
|
|
110
|
+
require('../../views/ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.cjs');
|
|
111
|
+
require('../../views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
112
|
+
require('../../../../store/state/tokenBalances.cjs');
|
|
113
|
+
require('../../../../store/state/multichainBalances.cjs');
|
|
114
|
+
require('@dynamic-labs/store');
|
|
115
|
+
require('../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
116
|
+
var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
117
|
+
|
|
118
|
+
const DUST_SEGMENTS = 20;
|
|
119
|
+
const truncateToDecimals = (value, decimals) => {
|
|
120
|
+
const [whole, fractional] = value.split('.');
|
|
121
|
+
if (!fractional || decimals <= 0)
|
|
122
|
+
return whole;
|
|
123
|
+
const sliced = fractional.slice(0, decimals);
|
|
124
|
+
let end = sliced.length;
|
|
125
|
+
while (end > 0 && sliced[end - 1] === '0') {
|
|
126
|
+
end -= 1;
|
|
127
|
+
}
|
|
128
|
+
const trimmed = sliced.slice(0, end);
|
|
129
|
+
return trimmed.length > 0 ? `${whole}.${trimmed}` : whole;
|
|
130
|
+
};
|
|
131
|
+
const getDustFillCount = (balance, cap) => {
|
|
132
|
+
const b = parseFloat(balance);
|
|
133
|
+
const c = parseFloat(cap);
|
|
134
|
+
if (!c || isNaN(b) || isNaN(c))
|
|
135
|
+
return 0;
|
|
136
|
+
return Math.round(Math.min(b / c, 1) * DUST_SEGMENTS);
|
|
137
|
+
};
|
|
138
|
+
const TABS = [
|
|
139
|
+
{
|
|
140
|
+
copykey: 'dyn_active_wallet_info.midnight_shielded_balance',
|
|
141
|
+
id: 'shielded',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
copykey: 'dyn_active_wallet_info.midnight_unshielded_balance',
|
|
145
|
+
id: 'unshielded',
|
|
146
|
+
},
|
|
147
|
+
];
|
|
148
|
+
const ActiveMidnightWalletBalance = ({ isLoading = false, }) => {
|
|
149
|
+
const { t } = reactI18next.useTranslation();
|
|
150
|
+
const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
151
|
+
const [activeTab, setActiveTab] = React.useState('shielded');
|
|
152
|
+
const walletAddress = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address;
|
|
153
|
+
const enabled = Boolean(!isLoading && primaryWallet && walletConnectorCore.isMidnightConnector(primaryWallet.connector));
|
|
154
|
+
const { data: balances, isLoading: balancesLoading } = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
155
|
+
if (!primaryWallet ||
|
|
156
|
+
!walletConnectorCore.isMidnightConnector(primaryWallet.connector) ||
|
|
157
|
+
!walletConnectorCore.isMidnightWallet(primaryWallet)) {
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
return primaryWallet.getFormattedBalances();
|
|
161
|
+
}), {
|
|
162
|
+
deps: [walletAddress, primaryWallet],
|
|
163
|
+
enabled,
|
|
164
|
+
});
|
|
165
|
+
const { dustBalance, shieldedBalance, unshieldedBalance } = balances !== null && balances !== void 0 ? balances : {};
|
|
166
|
+
if (isLoading || balancesLoading) {
|
|
167
|
+
return (jsxRuntime.jsx("div", { className: 'active-midnight-balance', children: jsxRuntime.jsx(Skeleton.Skeleton, { className: 'active-midnight-balance__skeleton' }) }));
|
|
168
|
+
}
|
|
169
|
+
const dustFill = dustBalance
|
|
170
|
+
? getDustFillCount(dustBalance.balance, dustBalance.cap)
|
|
171
|
+
: 0;
|
|
172
|
+
const dustBalanceDisplay = dustBalance
|
|
173
|
+
? {
|
|
174
|
+
balance: truncateToDecimals(dustBalance.balance, 2),
|
|
175
|
+
cap: truncateToDecimals(dustBalance.cap, 2),
|
|
176
|
+
}
|
|
177
|
+
: undefined;
|
|
178
|
+
const activeBalance = activeTab === 'shielded' ? shieldedBalance : unshieldedBalance;
|
|
179
|
+
return (jsxRuntime.jsx("div", { className: 'active-midnight-balance', children: jsxRuntime.jsxs("div", { className: 'active-midnight-balance__card', children: [dustBalance && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: 'active-midnight-balance__dust', children: [jsxRuntime.jsxs("div", { className: 'active-midnight-balance__dust-header', children: [jsxRuntime.jsxs("div", { className: 'active-midnight-balance__dust-title', children: [jsxRuntime.jsx("svg", { className: 'active-midnight-balance__dust-icon', width: '12', height: '12', viewBox: '0 0 24 24', children: jsxRuntime.jsx("path", { d: 'M13 2L3 14h9l-1 8 10-12h-9l1-8z' }) }), jsxRuntime.jsx("span", { className: 'active-midnight-balance__dust-label', "data-copykey": 'dyn_active_wallet_info.midnight_dust_generating', children: t('dyn_active_wallet_info.midnight_dust_generating') })] }), jsxRuntime.jsxs("span", { className: 'active-midnight-balance__dust-count', children: [dustBalanceDisplay === null || dustBalanceDisplay === void 0 ? void 0 : dustBalanceDisplay.balance, "/", dustBalanceDisplay === null || dustBalanceDisplay === void 0 ? void 0 : dustBalanceDisplay.cap] })] }), jsxRuntime.jsx("div", { className: 'active-midnight-balance__dust-bar', children: Array.from({ length: DUST_SEGMENTS }, (_, i) => (jsxRuntime.jsx("div", { className: [
|
|
180
|
+
'active-midnight-balance__dust-segment',
|
|
181
|
+
i === 0 && 'active-midnight-balance__dust-segment--first',
|
|
182
|
+
i === DUST_SEGMENTS - 1 &&
|
|
183
|
+
'active-midnight-balance__dust-segment--last',
|
|
184
|
+
i < dustFill &&
|
|
185
|
+
'active-midnight-balance__dust-segment--filled',
|
|
186
|
+
]
|
|
187
|
+
.filter(Boolean)
|
|
188
|
+
.join(' ') }, i))) })] }), jsxRuntime.jsx("div", { className: 'active-midnight-balance__divider' })] })), jsxRuntime.jsx("div", { className: 'active-midnight-balance__tab-bar', children: TABS.map(({ id, copykey }) => (jsxRuntime.jsx("button", { className: classNames.classNames('active-midnight-balance__tab', {
|
|
189
|
+
'active-midnight-balance__tab--active': activeTab === id,
|
|
190
|
+
}), "data-copykey": copykey, onClick: () => setActiveTab(id), children: t(copykey) }, id))) }), jsxRuntime.jsxs("div", { className: 'active-midnight-balance__pocket', children: [activeTab === 'shielded' ? (jsxRuntime.jsx(midnightShielded.ReactComponent, { className: 'active-midnight-balance__pocket-icon' })) : (jsxRuntime.jsx(midnightUnshielded.ReactComponent, { className: 'active-midnight-balance__pocket-icon' })), jsxRuntime.jsxs("span", { className: 'active-midnight-balance__amount', children: [activeBalance !== null && activeBalance !== void 0 ? activeBalance : '—', " NIGHT"] })] })] }) }));
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
exports.ActiveMidnightWalletBalance = ActiveMidnightWalletBalance;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
3
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { isMidnightConnector, isMidnightWallet } from '@dynamic-labs/wallet-connector-core';
|
|
7
|
+
import { Skeleton } from '../../../../components/Skeleton/Skeleton.js';
|
|
8
|
+
import '../../../../context/DynamicContext/DynamicContext.js';
|
|
9
|
+
import '../../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
10
|
+
import '@dynamic-labs/iconic';
|
|
11
|
+
import { ReactComponent as SvgMidnightShielded } from '../../../../shared/assets/midnight-shielded.js';
|
|
12
|
+
import { ReactComponent as SvgMidnightUnshielded } from '../../../../shared/assets/midnight-unshielded.js';
|
|
13
|
+
import '../../../../context/ViewContext/ViewContext.js';
|
|
14
|
+
import '../../../../shared/logger.js';
|
|
15
|
+
import '@dynamic-labs/wallet-book';
|
|
16
|
+
import '@dynamic-labs/utils';
|
|
17
|
+
import '../../../../utils/constants/colors.js';
|
|
18
|
+
import '../../../../utils/constants/values.js';
|
|
19
|
+
import '@dynamic-labs/sdk-api-core';
|
|
20
|
+
import '../../../../shared/consts/index.js';
|
|
21
|
+
import '../../../../events/dynamicEvents.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 '../../../../store/state/authMode/authMode.js';
|
|
40
|
+
import '../../../../context/VerificationContext/VerificationContext.js';
|
|
41
|
+
import 'react-dom';
|
|
42
|
+
import '../../../../utils/functions/compareChains/compareChains.js';
|
|
43
|
+
import '../../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
|
|
44
|
+
import '../../../../context/ThemeContext/ThemeContext.js';
|
|
45
|
+
import '../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
|
|
46
|
+
import 'bs58';
|
|
47
|
+
import { usePromise } from '../../../../utils/hooks/usePromise/usePromise.js';
|
|
48
|
+
import '@dynamic-labs/types';
|
|
49
|
+
import '../../../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
50
|
+
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
51
|
+
import '../../../../context/WalletContext/WalletContext.js';
|
|
52
|
+
import '../../../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
53
|
+
import 'yup';
|
|
54
|
+
import '../../../../context/MockContext/MockContext.js';
|
|
55
|
+
import '../../../../views/CollectUserDataView/useFields.js';
|
|
56
|
+
import '../../../../context/FieldsStateContext/FieldsStateContext.js';
|
|
57
|
+
import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
58
|
+
import '@dynamic-labs/rpc-providers';
|
|
59
|
+
import '../../../../store/state/walletOptions/walletOptions.js';
|
|
60
|
+
import '../../../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
61
|
+
import { classNames } from '../../../../utils/functions/classNames/classNames.js';
|
|
62
|
+
import '../../../../components/Alert/Alert.js';
|
|
63
|
+
import '../../../../components/ShadowDOM/ShadowDOM.js';
|
|
64
|
+
import '../../../../components/IconButton/IconButton.js';
|
|
65
|
+
import '../../../../components/InlineWidget/InlineWidget.js';
|
|
66
|
+
import '../../../../components/Input/Input.js';
|
|
67
|
+
import '../../../../components/IsBrowser/IsBrowser.js';
|
|
68
|
+
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
69
|
+
import '../../../../components/OverlayCard/OverlayCard.js';
|
|
70
|
+
import '../../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
71
|
+
import '../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
72
|
+
import '../../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
73
|
+
import '../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
74
|
+
import '../../../../components/Popper/Popper/Popper.js';
|
|
75
|
+
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
76
|
+
import 'react-focus-lock';
|
|
77
|
+
import 'qrcode';
|
|
78
|
+
import 'formik';
|
|
79
|
+
import '../../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
|
|
80
|
+
import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
81
|
+
import '../../context/DynamicWidgetContext.js';
|
|
82
|
+
import '../../../../utils/hooks/useGetMfaToken/useGetMfaToken.js';
|
|
83
|
+
import '../../../../utils/hooks/useWalletBackup/useWalletBackup.js';
|
|
84
|
+
import '../../../../utils/hooks/useWalletBackup/types.js';
|
|
85
|
+
import '../../../../utils/hooks/useWalletBackup/cloudProviders.js';
|
|
86
|
+
import '../../../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
87
|
+
import '../../../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
88
|
+
import '../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
89
|
+
import '@hcaptcha/react-hcaptcha';
|
|
90
|
+
import '../../helpers/convertExchangeKeyAndProviderEnum.js';
|
|
91
|
+
import '../../../../views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.js';
|
|
92
|
+
import '../../../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
|
|
93
|
+
import '../../../../context/FooterAnimationContext/index.js';
|
|
94
|
+
import '../../../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.js';
|
|
95
|
+
import '../../../../context/PasskeyContext/PasskeyContext.js';
|
|
96
|
+
import '../../../../context/OnrampContext/OnrampContext.js';
|
|
97
|
+
import '../../../../store/state/sendBalances.js';
|
|
98
|
+
import '../../../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
99
|
+
import '../../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
100
|
+
import '../DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
101
|
+
import '../../../../views/TransactionConfirmationView/TransactionConfirmationView.js';
|
|
102
|
+
import '../PasskeyCard/PasskeyCard.js';
|
|
103
|
+
import '../../views/CryptoComOnramp/CryptoComOnramp.js';
|
|
104
|
+
import '../../../../../index.js';
|
|
105
|
+
import '../../views/ManagePasskeysMfaWidgetView/ManagePasskeysMfaWidgetView.js';
|
|
106
|
+
import '../../views/ManageTotpMfaWidgetView/ManageTotpMfaWidgetView.js';
|
|
107
|
+
import '../../views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
108
|
+
import '../../../../store/state/tokenBalances.js';
|
|
109
|
+
import '../../../../store/state/multichainBalances.js';
|
|
110
|
+
import '@dynamic-labs/store';
|
|
111
|
+
import '../../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
112
|
+
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
113
|
+
|
|
114
|
+
const DUST_SEGMENTS = 20;
|
|
115
|
+
const truncateToDecimals = (value, decimals) => {
|
|
116
|
+
const [whole, fractional] = value.split('.');
|
|
117
|
+
if (!fractional || decimals <= 0)
|
|
118
|
+
return whole;
|
|
119
|
+
const sliced = fractional.slice(0, decimals);
|
|
120
|
+
let end = sliced.length;
|
|
121
|
+
while (end > 0 && sliced[end - 1] === '0') {
|
|
122
|
+
end -= 1;
|
|
123
|
+
}
|
|
124
|
+
const trimmed = sliced.slice(0, end);
|
|
125
|
+
return trimmed.length > 0 ? `${whole}.${trimmed}` : whole;
|
|
126
|
+
};
|
|
127
|
+
const getDustFillCount = (balance, cap) => {
|
|
128
|
+
const b = parseFloat(balance);
|
|
129
|
+
const c = parseFloat(cap);
|
|
130
|
+
if (!c || isNaN(b) || isNaN(c))
|
|
131
|
+
return 0;
|
|
132
|
+
return Math.round(Math.min(b / c, 1) * DUST_SEGMENTS);
|
|
133
|
+
};
|
|
134
|
+
const TABS = [
|
|
135
|
+
{
|
|
136
|
+
copykey: 'dyn_active_wallet_info.midnight_shielded_balance',
|
|
137
|
+
id: 'shielded',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
copykey: 'dyn_active_wallet_info.midnight_unshielded_balance',
|
|
141
|
+
id: 'unshielded',
|
|
142
|
+
},
|
|
143
|
+
];
|
|
144
|
+
const ActiveMidnightWalletBalance = ({ isLoading = false, }) => {
|
|
145
|
+
const { t } = useTranslation();
|
|
146
|
+
const { primaryWallet } = useInternalDynamicContext();
|
|
147
|
+
const [activeTab, setActiveTab] = useState('shielded');
|
|
148
|
+
const walletAddress = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address;
|
|
149
|
+
const enabled = Boolean(!isLoading && primaryWallet && isMidnightConnector(primaryWallet.connector));
|
|
150
|
+
const { data: balances, isLoading: balancesLoading } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
151
|
+
if (!primaryWallet ||
|
|
152
|
+
!isMidnightConnector(primaryWallet.connector) ||
|
|
153
|
+
!isMidnightWallet(primaryWallet)) {
|
|
154
|
+
return undefined;
|
|
155
|
+
}
|
|
156
|
+
return primaryWallet.getFormattedBalances();
|
|
157
|
+
}), {
|
|
158
|
+
deps: [walletAddress, primaryWallet],
|
|
159
|
+
enabled,
|
|
160
|
+
});
|
|
161
|
+
const { dustBalance, shieldedBalance, unshieldedBalance } = balances !== null && balances !== void 0 ? balances : {};
|
|
162
|
+
if (isLoading || balancesLoading) {
|
|
163
|
+
return (jsx("div", { className: 'active-midnight-balance', children: jsx(Skeleton, { className: 'active-midnight-balance__skeleton' }) }));
|
|
164
|
+
}
|
|
165
|
+
const dustFill = dustBalance
|
|
166
|
+
? getDustFillCount(dustBalance.balance, dustBalance.cap)
|
|
167
|
+
: 0;
|
|
168
|
+
const dustBalanceDisplay = dustBalance
|
|
169
|
+
? {
|
|
170
|
+
balance: truncateToDecimals(dustBalance.balance, 2),
|
|
171
|
+
cap: truncateToDecimals(dustBalance.cap, 2),
|
|
172
|
+
}
|
|
173
|
+
: undefined;
|
|
174
|
+
const activeBalance = activeTab === 'shielded' ? shieldedBalance : unshieldedBalance;
|
|
175
|
+
return (jsx("div", { className: 'active-midnight-balance', children: jsxs("div", { className: 'active-midnight-balance__card', children: [dustBalance && (jsxs(Fragment, { children: [jsxs("div", { className: 'active-midnight-balance__dust', children: [jsxs("div", { className: 'active-midnight-balance__dust-header', children: [jsxs("div", { className: 'active-midnight-balance__dust-title', children: [jsx("svg", { className: 'active-midnight-balance__dust-icon', width: '12', height: '12', viewBox: '0 0 24 24', children: jsx("path", { d: 'M13 2L3 14h9l-1 8 10-12h-9l1-8z' }) }), jsx("span", { className: 'active-midnight-balance__dust-label', "data-copykey": 'dyn_active_wallet_info.midnight_dust_generating', children: t('dyn_active_wallet_info.midnight_dust_generating') })] }), jsxs("span", { className: 'active-midnight-balance__dust-count', children: [dustBalanceDisplay === null || dustBalanceDisplay === void 0 ? void 0 : dustBalanceDisplay.balance, "/", dustBalanceDisplay === null || dustBalanceDisplay === void 0 ? void 0 : dustBalanceDisplay.cap] })] }), jsx("div", { className: 'active-midnight-balance__dust-bar', children: Array.from({ length: DUST_SEGMENTS }, (_, i) => (jsx("div", { className: [
|
|
176
|
+
'active-midnight-balance__dust-segment',
|
|
177
|
+
i === 0 && 'active-midnight-balance__dust-segment--first',
|
|
178
|
+
i === DUST_SEGMENTS - 1 &&
|
|
179
|
+
'active-midnight-balance__dust-segment--last',
|
|
180
|
+
i < dustFill &&
|
|
181
|
+
'active-midnight-balance__dust-segment--filled',
|
|
182
|
+
]
|
|
183
|
+
.filter(Boolean)
|
|
184
|
+
.join(' ') }, i))) })] }), jsx("div", { className: 'active-midnight-balance__divider' })] })), jsx("div", { className: 'active-midnight-balance__tab-bar', children: TABS.map(({ id, copykey }) => (jsx("button", { className: classNames('active-midnight-balance__tab', {
|
|
185
|
+
'active-midnight-balance__tab--active': activeTab === id,
|
|
186
|
+
}), "data-copykey": copykey, onClick: () => setActiveTab(id), children: t(copykey) }, id))) }), jsxs("div", { className: 'active-midnight-balance__pocket', children: [activeTab === 'shielded' ? (jsx(SvgMidnightShielded, { className: 'active-midnight-balance__pocket-icon' })) : (jsx(SvgMidnightUnshielded, { className: 'active-midnight-balance__pocket-icon' })), jsxs("span", { className: 'active-midnight-balance__amount', children: [activeBalance !== null && activeBalance !== void 0 ? activeBalance : '—', " NIGHT"] })] })] }) }));
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export { ActiveMidnightWalletBalance };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ActiveMidnightWalletBalance } from './ActiveMidnightWalletBalance';
|
package/src/lib/widgets/DynamicWidget/components/ActiveWalletBalance/ActiveWalletBalance.cjs
CHANGED
|
@@ -121,6 +121,8 @@ require('@dynamic-labs/store');
|
|
|
121
121
|
require('../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
122
122
|
var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
123
123
|
var useAleoShieldedBalances = require('../../../../utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.cjs');
|
|
124
|
+
var useAleoAutoMergeRecords = require('../../../../utils/hooks/useAleoAutoMergeRecords/useAleoAutoMergeRecords.cjs');
|
|
125
|
+
var useAleoAutoShieldSponsoredTokens = require('../../../../utils/hooks/useAleoAutoShieldSponsoredTokens/useAleoAutoShieldSponsoredTokens.cjs');
|
|
124
126
|
var TokenBalanceList = require('./TokenBalanceList/TokenBalanceList.cjs');
|
|
125
127
|
|
|
126
128
|
/** Component to display token balances for the primary wallet */
|
|
@@ -178,6 +180,26 @@ const ActiveWalletBalance = ({ isLoading = false, }) => {
|
|
|
178
180
|
}
|
|
179
181
|
return undefined;
|
|
180
182
|
}, [primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector]);
|
|
183
|
+
// Auto-merge sponsored programs on wallet load. Reads owned records,
|
|
184
|
+
// groups by program, and silently fires `joinRecords` per program with
|
|
185
|
+
// ≥2 records when the Aleo Feemaster covers `join`. Programs that
|
|
186
|
+
// Feemaster doesn't sponsor are skipped — the manual "Merge all
|
|
187
|
+
// records" demo CTA still dispatches user-paid for those.
|
|
188
|
+
useAleoAutoMergeRecords.useAleoAutoMergeRecords();
|
|
189
|
+
// Auto-shield sponsored tokens on wallet load (and on each unshielded
|
|
190
|
+
// balance refresh). Iterates the unshielded list and silently fires
|
|
191
|
+
// `shieldToken` for tokens whose `transfer_public_to_private` is
|
|
192
|
+
// Feemaster-sponsored. Unsponsored tokens stay on the manual Shield
|
|
193
|
+
// Manually CTA, which prompts the user-paid confirmation modal.
|
|
194
|
+
const { isShielding: isAutoShielding } = useAleoAutoShieldSponsoredTokens.useAleoAutoShieldSponsoredTokens({
|
|
195
|
+
accountAddress: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address,
|
|
196
|
+
onShielded: React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
197
|
+
yield fetchAccountBalances(true);
|
|
198
|
+
yield refetchShielded();
|
|
199
|
+
}), [fetchAccountBalances, refetchShielded]),
|
|
200
|
+
shieldHandle: aleoShieldHandle,
|
|
201
|
+
unshieldedTokenBalances: unshieldedTokenBalances,
|
|
202
|
+
});
|
|
181
203
|
// Token currently awaiting user-paid fee confirmation. Set when
|
|
182
204
|
// Shield Manually is clicked on a token Feemaster doesn't sponsor;
|
|
183
205
|
// cleared on Cancel or after the modal's Shield button dispatches.
|
|
@@ -393,7 +415,10 @@ const ActiveWalletBalance = ({ isLoading = false, }) => {
|
|
|
393
415
|
fontWeight: activeShieldTab === 'unshielded' ? 600 : 400,
|
|
394
416
|
opacity: activeShieldTab === 'unshielded' ? 1 : 0.5,
|
|
395
417
|
padding: 0,
|
|
396
|
-
}, children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', children: "Unshielded" }) })] })),
|
|
418
|
+
}, children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', children: "Unshielded" }) })] })), isAutoShielding && (jsxRuntime.jsx("div", { className: 'auto-shield-status', "data-testid": 'auto-shield-status', style: {
|
|
419
|
+
opacity: 0.7,
|
|
420
|
+
padding: '4px 16px 8px 16px',
|
|
421
|
+
}, children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', children: "Auto-shielding\u2026" }) })), jsxRuntime.jsx(TokenBalanceList.TokenBalanceList, { tokenBalances: filteredTokenBalances, getSecondaryAction: getSecondaryAction })] })] }), jsxRuntime.jsx(Portal.Portal, { elementId: 'dynamic-shield-confirm', isShown: Boolean(pendingShieldToken), zIndex: index.authModalZIndex, withBackdrop: true, handleClose: () => setPendingShieldToken(null), children: jsxRuntime.jsx(Modal.Modal, { children: jsxRuntime.jsx(ModalCard.ModalCard, { children: jsxRuntime.jsxs("div", { style: { padding: 24 }, children: [jsxRuntime.jsxs(Typography.Typography, { variant: 'title', weight: 'medium', color: 'primary', children: ["Shield ", (_d = pendingShieldToken === null || pendingShieldToken === void 0 ? void 0 : pendingShieldToken.balance) !== null && _d !== void 0 ? _d : '', ' ', (_e = pendingShieldToken === null || pendingShieldToken === void 0 ? void 0 : pendingShieldToken.symbol) !== null && _e !== void 0 ? _e : ''] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', style: { display: 'block', marginTop: 8 }, children: "This token doesn't support auto-shielding. A network fee is required to shield manually." }), jsxRuntime.jsxs("div", { style: {
|
|
397
422
|
display: 'flex',
|
|
398
423
|
gap: 8,
|
|
399
424
|
marginTop: 24,
|
|
@@ -117,6 +117,8 @@ import '@dynamic-labs/store';
|
|
|
117
117
|
import '../../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
118
118
|
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
119
119
|
import { useAleoShieldedBalances } from '../../../../utils/hooks/useAleoShieldedBalances/useAleoShieldedBalances.js';
|
|
120
|
+
import { useAleoAutoMergeRecords } from '../../../../utils/hooks/useAleoAutoMergeRecords/useAleoAutoMergeRecords.js';
|
|
121
|
+
import { useAleoAutoShieldSponsoredTokens } from '../../../../utils/hooks/useAleoAutoShieldSponsoredTokens/useAleoAutoShieldSponsoredTokens.js';
|
|
120
122
|
import { TokenBalanceList } from './TokenBalanceList/TokenBalanceList.js';
|
|
121
123
|
|
|
122
124
|
/** Component to display token balances for the primary wallet */
|
|
@@ -174,6 +176,26 @@ const ActiveWalletBalance = ({ isLoading = false, }) => {
|
|
|
174
176
|
}
|
|
175
177
|
return undefined;
|
|
176
178
|
}, [primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector]);
|
|
179
|
+
// Auto-merge sponsored programs on wallet load. Reads owned records,
|
|
180
|
+
// groups by program, and silently fires `joinRecords` per program with
|
|
181
|
+
// ≥2 records when the Aleo Feemaster covers `join`. Programs that
|
|
182
|
+
// Feemaster doesn't sponsor are skipped — the manual "Merge all
|
|
183
|
+
// records" demo CTA still dispatches user-paid for those.
|
|
184
|
+
useAleoAutoMergeRecords();
|
|
185
|
+
// Auto-shield sponsored tokens on wallet load (and on each unshielded
|
|
186
|
+
// balance refresh). Iterates the unshielded list and silently fires
|
|
187
|
+
// `shieldToken` for tokens whose `transfer_public_to_private` is
|
|
188
|
+
// Feemaster-sponsored. Unsponsored tokens stay on the manual Shield
|
|
189
|
+
// Manually CTA, which prompts the user-paid confirmation modal.
|
|
190
|
+
const { isShielding: isAutoShielding } = useAleoAutoShieldSponsoredTokens({
|
|
191
|
+
accountAddress: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address,
|
|
192
|
+
onShielded: useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
193
|
+
yield fetchAccountBalances(true);
|
|
194
|
+
yield refetchShielded();
|
|
195
|
+
}), [fetchAccountBalances, refetchShielded]),
|
|
196
|
+
shieldHandle: aleoShieldHandle,
|
|
197
|
+
unshieldedTokenBalances: unshieldedTokenBalances,
|
|
198
|
+
});
|
|
177
199
|
// Token currently awaiting user-paid fee confirmation. Set when
|
|
178
200
|
// Shield Manually is clicked on a token Feemaster doesn't sponsor;
|
|
179
201
|
// cleared on Cancel or after the modal's Shield button dispatches.
|
|
@@ -389,7 +411,10 @@ const ActiveWalletBalance = ({ isLoading = false, }) => {
|
|
|
389
411
|
fontWeight: activeShieldTab === 'unshielded' ? 600 : 400,
|
|
390
412
|
opacity: activeShieldTab === 'unshielded' ? 1 : 0.5,
|
|
391
413
|
padding: 0,
|
|
392
|
-
}, children: jsx(Typography, { variant: 'body_normal', children: "Unshielded" }) })] })),
|
|
414
|
+
}, children: jsx(Typography, { variant: 'body_normal', children: "Unshielded" }) })] })), isAutoShielding && (jsx("div", { className: 'auto-shield-status', "data-testid": 'auto-shield-status', style: {
|
|
415
|
+
opacity: 0.7,
|
|
416
|
+
padding: '4px 16px 8px 16px',
|
|
417
|
+
}, children: jsx(Typography, { variant: 'body_small', children: "Auto-shielding\u2026" }) })), jsx(TokenBalanceList, { tokenBalances: filteredTokenBalances, getSecondaryAction: getSecondaryAction })] })] }), jsx(Portal, { elementId: 'dynamic-shield-confirm', isShown: Boolean(pendingShieldToken), zIndex: authModalZIndex, withBackdrop: true, handleClose: () => setPendingShieldToken(null), children: jsx(Modal, { children: jsx(ModalCard, { children: jsxs("div", { style: { padding: 24 }, children: [jsxs(Typography, { variant: 'title', weight: 'medium', color: 'primary', children: ["Shield ", (_d = pendingShieldToken === null || pendingShieldToken === void 0 ? void 0 : pendingShieldToken.balance) !== null && _d !== void 0 ? _d : '', ' ', (_e = pendingShieldToken === null || pendingShieldToken === void 0 ? void 0 : pendingShieldToken.symbol) !== null && _e !== void 0 ? _e : ''] }), jsx(Typography, { variant: 'body_normal', color: 'secondary', style: { display: 'block', marginTop: 8 }, children: "This token doesn't support auto-shielding. A network fee is required to shield manually." }), jsxs("div", { style: {
|
|
393
418
|
display: 'flex',
|
|
394
419
|
gap: 8,
|
|
395
420
|
marginTop: 24,
|