@dynamic-labs/sdk-react-core 4.37.1 → 4.37.2
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 +15 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +13 -13
- package/src/lib/client/extension/deprecated/mfa/verifyTotpMfaDevice/verifyTotpMfaDevice.d.ts +1 -1
- package/src/lib/data/api/waas/index.d.ts +1 -0
- package/src/lib/data/api/waas/waas.cjs +37 -0
- package/src/lib/data/api/waas/waas.d.ts +2 -0
- package/src/lib/data/api/waas/waas.js +33 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +54 -19
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +7 -2
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +54 -19
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +5 -0
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.d.ts +1 -0
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +5 -0
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.cjs +106 -34
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.d.ts +4 -0
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.js +106 -34
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.d.ts +2 -2
- package/src/lib/views/WaasUpgradeView/WaasUpgradeView.cjs +7 -7
- package/src/lib/views/WaasUpgradeView/WaasUpgradeView.js +7 -7
- package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.cjs +51 -52
- package/src/lib/views/WalletDelegation/WalletDelegationView/WalletDelegationView.js +52 -53
- package/src/lib/views/WalletList/data.d.ts +1 -1
- package/src/lib/views/WalletUpgradeFlowView/WalletUpgradeFlowView.cjs +1 -1
- package/src/lib/views/WalletUpgradeFlowView/WalletUpgradeFlowView.js +1 -1
|
@@ -27,7 +27,6 @@ require('../../../context/ViewContext/ViewContext.cjs');
|
|
|
27
27
|
var logger = require('../../../shared/logger.cjs');
|
|
28
28
|
var useMutation = require('../../../utils/hooks/useMutation/useMutation.cjs');
|
|
29
29
|
var settingsUtils = require('../../../store/utils/settingsUtils/settingsUtils.cjs');
|
|
30
|
-
var UserWalletsContext = require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
31
30
|
var useDynamicWaas = require('../../../utils/hooks/useDynamicWaas/useDynamicWaas.cjs');
|
|
32
31
|
var WalletIconWithNetwork = require('../../../widgets/DynamicWidget/components/WalletIconWithNetwork/WalletIconWithNetwork.cjs');
|
|
33
32
|
var useWalletDelegation = require('../../../utils/hooks/useWalletDelegation/useWalletDelegation.cjs');
|
|
@@ -40,24 +39,24 @@ const WalletDelegationView = ({ wallets, }) => {
|
|
|
40
39
|
const { setShowAuthFlow, handleLogOut } = useInternalDynamicContext.useInternalDynamicContext();
|
|
41
40
|
const { user } = useDynamicContext.useDynamicContext();
|
|
42
41
|
const appName = settingsUtils.useAppName();
|
|
43
|
-
const { userWallets } = UserWalletsContext.useInternalUserWallets();
|
|
44
42
|
const { delegateKeyShares } = useDynamicWaas.useDynamicWaas();
|
|
45
|
-
const { requiresDelegation } = useWalletDelegation.useWalletDelegation();
|
|
43
|
+
const { requiresDelegation, denyWalletDelegation, getWalletsDelegatedStatus, } = useWalletDelegation.useWalletDelegation();
|
|
46
44
|
const [selectedWallets, setSelectedWallets] = React.useState(new Set());
|
|
47
45
|
const [showEditView, setShowEditView] = React.useState(false);
|
|
48
46
|
const [agreementChecked, setAgreementChecked] = React.useState(false);
|
|
49
47
|
const [selectionInitialized, setSelectionInitialized] = React.useState(false);
|
|
50
48
|
// Get waas wallets that are not yet delegated or use provided wallets override
|
|
51
49
|
const waasWallets = React.useMemo(() => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
50
|
+
if (wallets && wallets.length > 0) {
|
|
51
|
+
return wallets;
|
|
52
|
+
}
|
|
53
|
+
// Get wallet status from the hook
|
|
54
|
+
const walletsWithStatus = getWalletsDelegatedStatus();
|
|
55
|
+
// Filter to only include pending wallets (not delegated or denied)
|
|
56
|
+
return walletsWithStatus
|
|
57
|
+
.filter((wallet) => wallet.status === 'pending')
|
|
58
|
+
.filter((wallet) => wallet.key.startsWith('dynamicwaas'));
|
|
59
|
+
}, [wallets, getWalletsDelegatedStatus]);
|
|
61
60
|
// Auto-select wallets only on initial load
|
|
62
61
|
React.useEffect(() => {
|
|
63
62
|
if (selectionInitialized)
|
|
@@ -96,45 +95,45 @@ const WalletDelegationView = ({ wallets, }) => {
|
|
|
96
95
|
setSelectionInitialized(true);
|
|
97
96
|
setSelectedWallets(new Set());
|
|
98
97
|
};
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
98
|
+
const handleDenySelectedWallets = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
99
|
+
try {
|
|
100
|
+
// Deny each selected wallet
|
|
101
|
+
for (const walletId of selectedWallets) {
|
|
102
|
+
yield denyWalletDelegation(walletId);
|
|
103
|
+
}
|
|
104
|
+
// Close the auth flow after successful denial
|
|
105
|
+
setShowAuthFlow(false);
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
logger.logger.error('Failed to deny wallet delegation', error);
|
|
109
|
+
// Still close the flow even on error to avoid blocking the user
|
|
110
|
+
setShowAuthFlow(false);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
108
113
|
const { mutate: handleDelegateWallets, isLoading, error, data: isSuccess, } = useMutation.useMutation(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
109
114
|
if (selectedWallets.size === 0) {
|
|
110
115
|
throw new utils.DynamicError('No wallets selected for delegation');
|
|
111
116
|
}
|
|
112
117
|
const selectedWalletObjects = waasWallets.filter((wallet) => selectedWallets.has(wallet.id));
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
chainName: wallet.chain,
|
|
118
|
-
});
|
|
119
|
-
// Emit success event for each wallet
|
|
120
|
-
dynamicEvents.dynamicEvents.emit('embeddedWalletDelegationCompleted', wallet);
|
|
121
|
-
return { success: true, wallet };
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
logger.logger.error(`Failed to delegate wallet ${wallet.id}`, error);
|
|
125
|
-
throw error;
|
|
126
|
-
}
|
|
118
|
+
// Prepare delegation array
|
|
119
|
+
const walletsToDelegate = selectedWalletObjects.map((wallet) => ({
|
|
120
|
+
accountAddress: wallet.address,
|
|
121
|
+
chainName: wallet.chain,
|
|
127
122
|
}));
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
123
|
+
try {
|
|
124
|
+
// Delegate all wallets at once
|
|
125
|
+
yield delegateKeyShares(walletsToDelegate);
|
|
126
|
+
// Emit success event for each wallet
|
|
127
|
+
selectedWalletObjects.forEach((wallet) => {
|
|
128
|
+
dynamicEvents.dynamicEvents.emit('embeddedWalletDelegationCompleted', wallet);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
logger.logger.error('Failed to delegate wallets', error);
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
// Delegation completion is tracked by the backend through keyShares
|
|
136
|
+
// No need to update local storage
|
|
138
137
|
// Emit overall success event
|
|
139
138
|
dynamicEvents.dynamicEvents.emit('embeddedWalletDelegationCompleted', selectedWalletObjects[0]);
|
|
140
139
|
return true;
|
|
@@ -195,9 +194,12 @@ const WalletDelegationView = ({ wallets, }) => {
|
|
|
195
194
|
// Edit view (full wallet selection)
|
|
196
195
|
const displayWaasWallets = () => (jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__wallet-selection', children: [jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__wallet-selection__header', children: [jsxRuntime.jsxs("div", { style: { display: 'flex', gap: '4px' }, children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: t('dyn_wallet_delegation.selected_wallets') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'tertiary', children: selectedWallets.size.toString().padStart(2, '0') })] }), jsxRuntime.jsx("button", { onClick: selectedWallets.size === waasWallets.length
|
|
197
196
|
? handleDeselectAll
|
|
198
|
-
: handleSelectAll, className: 'embedded-delegated-view__wallet-selection__deselect-all', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'tertiary', children: getSelectButtonText() }) })] }), jsxRuntime.jsx("div", { className: 'embedded-delegated-view__wallet-list', children: waasWallets === null || waasWallets === void 0 ? void 0 : waasWallets.map((wallet) =>
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
: handleSelectAll, className: 'embedded-delegated-view__wallet-selection__deselect-all', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'tertiary', children: getSelectButtonText() }) })] }), jsxRuntime.jsx("div", { className: 'embedded-delegated-view__wallet-list', children: waasWallets === null || waasWallets === void 0 ? void 0 : waasWallets.map((wallet) => {
|
|
198
|
+
var _a, _b;
|
|
199
|
+
return (jsxRuntime.jsx("div", { className: `embedded-delegated-view__wallet-item${selectedWallets.has(wallet.id)
|
|
200
|
+
? ' embedded-delegated-view__wallet-item--selected'
|
|
201
|
+
: ''}`, onClick: () => handleWalletToggle(wallet.id), children: jsxRuntime.jsxs("div", { className: 'embedded-delegated-view__wallet-item__content', children: [jsxRuntime.jsx("div", { className: 'embedded-delegated-view__wallet-item__icon', children: jsxRuntime.jsx(WalletIconWithNetwork.WalletIconWithNetwork, { walletKey: wallet.key, Icon: null, iconUrl: (_b = (_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.icon, chainName: wallet.chain, iconSize: 24, showNetwork: true }) }), jsxRuntime.jsx("div", { className: 'embedded-delegated-view__wallet-item__info', children: jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', weight: 'medium', children: [wallet.address.slice(0, 6), "...", wallet.address.slice(-4)] }) }), jsxRuntime.jsx("div", { className: 'embedded-delegated-view__wallet-item__checkbox', children: jsxRuntime.jsx(Checkbox.Checkbox, { checked: selectedWallets.has(wallet.id), onChange: (e) => e.stopPropagation(), value: wallet.id }) })] }) }, wallet.id));
|
|
202
|
+
}) })] }));
|
|
201
203
|
const navigationButton = showEditView ? (jsxRuntime.jsx(IconButton.IconButton, { onClick: () => {
|
|
202
204
|
setShowEditView(false);
|
|
203
205
|
// Reset agreement when coming back from edit view
|
|
@@ -261,10 +263,7 @@ const WalletDelegationView = ({ wallets, }) => {
|
|
|
261
263
|
}, onClick: () => handleDelegateWallets(), loading: isLoading, disabled: selectedWallets.size === 0 || !agreementChecked, dataTestId: 'embedded-delegation-button', copykey: 'dyn_wallet_delegation.approve_button', style: { width: '100%' }, className: 'embedded-delegated-view__body__button', expanded: true, children: t('dyn_wallet_delegation.approve_button') }), !isLoading && !requiresDelegation && (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', typographyProps: {
|
|
262
264
|
color: 'primary',
|
|
263
265
|
weight: 'bold',
|
|
264
|
-
}, onClick: () => {
|
|
265
|
-
persistDeniedWallets();
|
|
266
|
-
setShowAuthFlow(false);
|
|
267
|
-
}, dataTestId: 'embedded-delegation-deny-button', copykey: 'dyn_wallet_delegation.deny_button', style: {
|
|
266
|
+
}, onClick: () => handleDenySelectedWallets(), dataTestId: 'embedded-delegation-deny-button', copykey: 'dyn_wallet_delegation.deny_button', style: {
|
|
268
267
|
backgroundColor: 'white',
|
|
269
268
|
border: '1px solid var(--dynamic-base-4)',
|
|
270
269
|
width: '100%',
|
|
@@ -3,7 +3,7 @@ import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { useState, useMemo, useEffect } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import {
|
|
6
|
+
import { DynamicError, StorageService } from '@dynamic-labs/utils';
|
|
7
7
|
import { Checkbox } from '../../../components/Checkbox/Checkbox.js';
|
|
8
8
|
import { ErrorContainer } from '../../../components/ErrorContainer/ErrorContainer.js';
|
|
9
9
|
import { IconButton } from '../../../components/IconButton/IconButton.js';
|
|
@@ -23,7 +23,6 @@ import '../../../context/ViewContext/ViewContext.js';
|
|
|
23
23
|
import { logger } from '../../../shared/logger.js';
|
|
24
24
|
import { useMutation } from '../../../utils/hooks/useMutation/useMutation.js';
|
|
25
25
|
import { useAppName } from '../../../store/utils/settingsUtils/settingsUtils.js';
|
|
26
|
-
import { useInternalUserWallets } from '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
27
26
|
import { useDynamicWaas } from '../../../utils/hooks/useDynamicWaas/useDynamicWaas.js';
|
|
28
27
|
import { WalletIconWithNetwork } from '../../../widgets/DynamicWidget/components/WalletIconWithNetwork/WalletIconWithNetwork.js';
|
|
29
28
|
import { useWalletDelegation } from '../../../utils/hooks/useWalletDelegation/useWalletDelegation.js';
|
|
@@ -36,24 +35,24 @@ const WalletDelegationView = ({ wallets, }) => {
|
|
|
36
35
|
const { setShowAuthFlow, handleLogOut } = useInternalDynamicContext();
|
|
37
36
|
const { user } = useDynamicContext();
|
|
38
37
|
const appName = useAppName();
|
|
39
|
-
const { userWallets } = useInternalUserWallets();
|
|
40
38
|
const { delegateKeyShares } = useDynamicWaas();
|
|
41
|
-
const { requiresDelegation } = useWalletDelegation();
|
|
39
|
+
const { requiresDelegation, denyWalletDelegation, getWalletsDelegatedStatus, } = useWalletDelegation();
|
|
42
40
|
const [selectedWallets, setSelectedWallets] = useState(new Set());
|
|
43
41
|
const [showEditView, setShowEditView] = useState(false);
|
|
44
42
|
const [agreementChecked, setAgreementChecked] = useState(false);
|
|
45
43
|
const [selectionInitialized, setSelectionInitialized] = useState(false);
|
|
46
44
|
// Get waas wallets that are not yet delegated or use provided wallets override
|
|
47
45
|
const waasWallets = useMemo(() => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
if (wallets && wallets.length > 0) {
|
|
47
|
+
return wallets;
|
|
48
|
+
}
|
|
49
|
+
// Get wallet status from the hook
|
|
50
|
+
const walletsWithStatus = getWalletsDelegatedStatus();
|
|
51
|
+
// Filter to only include pending wallets (not delegated or denied)
|
|
52
|
+
return walletsWithStatus
|
|
53
|
+
.filter((wallet) => wallet.status === 'pending')
|
|
54
|
+
.filter((wallet) => wallet.key.startsWith('dynamicwaas'));
|
|
55
|
+
}, [wallets, getWalletsDelegatedStatus]);
|
|
57
56
|
// Auto-select wallets only on initial load
|
|
58
57
|
useEffect(() => {
|
|
59
58
|
if (selectionInitialized)
|
|
@@ -92,45 +91,45 @@ const WalletDelegationView = ({ wallets, }) => {
|
|
|
92
91
|
setSelectionInitialized(true);
|
|
93
92
|
setSelectedWallets(new Set());
|
|
94
93
|
};
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
94
|
+
const handleDenySelectedWallets = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
95
|
+
try {
|
|
96
|
+
// Deny each selected wallet
|
|
97
|
+
for (const walletId of selectedWallets) {
|
|
98
|
+
yield denyWalletDelegation(walletId);
|
|
99
|
+
}
|
|
100
|
+
// Close the auth flow after successful denial
|
|
101
|
+
setShowAuthFlow(false);
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
logger.error('Failed to deny wallet delegation', error);
|
|
105
|
+
// Still close the flow even on error to avoid blocking the user
|
|
106
|
+
setShowAuthFlow(false);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
104
109
|
const { mutate: handleDelegateWallets, isLoading, error, data: isSuccess, } = useMutation(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
105
110
|
if (selectedWallets.size === 0) {
|
|
106
111
|
throw new DynamicError('No wallets selected for delegation');
|
|
107
112
|
}
|
|
108
113
|
const selectedWalletObjects = waasWallets.filter((wallet) => selectedWallets.has(wallet.id));
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
chainName: wallet.chain,
|
|
114
|
-
});
|
|
115
|
-
// Emit success event for each wallet
|
|
116
|
-
dynamicEvents.emit('embeddedWalletDelegationCompleted', wallet);
|
|
117
|
-
return { success: true, wallet };
|
|
118
|
-
}
|
|
119
|
-
catch (error) {
|
|
120
|
-
logger.error(`Failed to delegate wallet ${wallet.id}`, error);
|
|
121
|
-
throw error;
|
|
122
|
-
}
|
|
114
|
+
// Prepare delegation array
|
|
115
|
+
const walletsToDelegate = selectedWalletObjects.map((wallet) => ({
|
|
116
|
+
accountAddress: wallet.address,
|
|
117
|
+
chainName: wallet.chain,
|
|
123
118
|
}));
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
119
|
+
try {
|
|
120
|
+
// Delegate all wallets at once
|
|
121
|
+
yield delegateKeyShares(walletsToDelegate);
|
|
122
|
+
// Emit success event for each wallet
|
|
123
|
+
selectedWalletObjects.forEach((wallet) => {
|
|
124
|
+
dynamicEvents.emit('embeddedWalletDelegationCompleted', wallet);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
logger.error('Failed to delegate wallets', error);
|
|
129
|
+
throw error;
|
|
130
|
+
}
|
|
131
|
+
// Delegation completion is tracked by the backend through keyShares
|
|
132
|
+
// No need to update local storage
|
|
134
133
|
// Emit overall success event
|
|
135
134
|
dynamicEvents.emit('embeddedWalletDelegationCompleted', selectedWalletObjects[0]);
|
|
136
135
|
return true;
|
|
@@ -191,9 +190,12 @@ const WalletDelegationView = ({ wallets, }) => {
|
|
|
191
190
|
// Edit view (full wallet selection)
|
|
192
191
|
const displayWaasWallets = () => (jsxs("div", { className: 'embedded-delegated-view__wallet-selection', children: [jsxs("div", { className: 'embedded-delegated-view__wallet-selection__header', children: [jsxs("div", { style: { display: 'flex', gap: '4px' }, children: [jsx(Typography, { variant: 'body_small', color: 'secondary', children: t('dyn_wallet_delegation.selected_wallets') }), jsx(Typography, { variant: 'body_small', color: 'tertiary', children: selectedWallets.size.toString().padStart(2, '0') })] }), jsx("button", { onClick: selectedWallets.size === waasWallets.length
|
|
193
192
|
? handleDeselectAll
|
|
194
|
-
: handleSelectAll, className: 'embedded-delegated-view__wallet-selection__deselect-all', children: jsx(Typography, { variant: 'body_small', color: 'tertiary', children: getSelectButtonText() }) })] }), jsx("div", { className: 'embedded-delegated-view__wallet-list', children: waasWallets === null || waasWallets === void 0 ? void 0 : waasWallets.map((wallet) =>
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
: handleSelectAll, className: 'embedded-delegated-view__wallet-selection__deselect-all', children: jsx(Typography, { variant: 'body_small', color: 'tertiary', children: getSelectButtonText() }) })] }), jsx("div", { className: 'embedded-delegated-view__wallet-list', children: waasWallets === null || waasWallets === void 0 ? void 0 : waasWallets.map((wallet) => {
|
|
194
|
+
var _a, _b;
|
|
195
|
+
return (jsx("div", { className: `embedded-delegated-view__wallet-item${selectedWallets.has(wallet.id)
|
|
196
|
+
? ' embedded-delegated-view__wallet-item--selected'
|
|
197
|
+
: ''}`, onClick: () => handleWalletToggle(wallet.id), children: jsxs("div", { className: 'embedded-delegated-view__wallet-item__content', children: [jsx("div", { className: 'embedded-delegated-view__wallet-item__icon', children: jsx(WalletIconWithNetwork, { walletKey: wallet.key, Icon: null, iconUrl: (_b = (_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.icon, chainName: wallet.chain, iconSize: 24, showNetwork: true }) }), jsx("div", { className: 'embedded-delegated-view__wallet-item__info', children: jsxs(Typography, { variant: 'body_small', weight: 'medium', children: [wallet.address.slice(0, 6), "...", wallet.address.slice(-4)] }) }), jsx("div", { className: 'embedded-delegated-view__wallet-item__checkbox', children: jsx(Checkbox, { checked: selectedWallets.has(wallet.id), onChange: (e) => e.stopPropagation(), value: wallet.id }) })] }) }, wallet.id));
|
|
198
|
+
}) })] }));
|
|
197
199
|
const navigationButton = showEditView ? (jsx(IconButton, { onClick: () => {
|
|
198
200
|
setShowEditView(false);
|
|
199
201
|
// Reset agreement when coming back from edit view
|
|
@@ -257,10 +259,7 @@ const WalletDelegationView = ({ wallets, }) => {
|
|
|
257
259
|
}, onClick: () => handleDelegateWallets(), loading: isLoading, disabled: selectedWallets.size === 0 || !agreementChecked, dataTestId: 'embedded-delegation-button', copykey: 'dyn_wallet_delegation.approve_button', style: { width: '100%' }, className: 'embedded-delegated-view__body__button', expanded: true, children: t('dyn_wallet_delegation.approve_button') }), !isLoading && !requiresDelegation && (jsx(TypographyButton, { buttonPadding: 'medium', buttonVariant: 'brand-primary', typographyProps: {
|
|
258
260
|
color: 'primary',
|
|
259
261
|
weight: 'bold',
|
|
260
|
-
}, onClick: () => {
|
|
261
|
-
persistDeniedWallets();
|
|
262
|
-
setShowAuthFlow(false);
|
|
263
|
-
}, dataTestId: 'embedded-delegation-deny-button', copykey: 'dyn_wallet_delegation.deny_button', style: {
|
|
262
|
+
}, onClick: () => handleDenySelectedWallets(), dataTestId: 'embedded-delegation-deny-button', copykey: 'dyn_wallet_delegation.deny_button', style: {
|
|
264
263
|
backgroundColor: 'white',
|
|
265
264
|
border: '1px solid var(--dynamic-base-4)',
|
|
266
265
|
width: '100%',
|
|
@@ -4,7 +4,7 @@ interface IChain {
|
|
|
4
4
|
enabled: boolean;
|
|
5
5
|
name: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const getEnabledChains: (chains: IChain[]) => ("STARK" | "
|
|
7
|
+
export declare const getEnabledChains: (chains: IChain[]) => ("STARK" | "ALGO" | "APTOS" | "ATOM" | "BTC" | "COSMOS" | "ECLIPSE" | "ETH" | "EVM" | "FLOW" | "SOL" | "SPARK" | "SUI" | "TRON")[];
|
|
8
8
|
type BaseGetSupportedWalletOpts = Omit<GetSupportedWalletsOpts, 'walletConnectProjectId' | 'chainRpcProviders'>;
|
|
9
9
|
export declare const getWallets: (props: {
|
|
10
10
|
getSupportedWalletOpts: BaseGetSupportedWalletOpts;
|
|
@@ -77,6 +77,7 @@ require('../../components/IconButton/IconButton.cjs');
|
|
|
77
77
|
var ModalHeader = require('../../components/ModalHeader/ModalHeader.cjs');
|
|
78
78
|
var TypographyButton = require('../../components/TypographyButton/TypographyButton.cjs');
|
|
79
79
|
var useDynamicWaas = require('../../utils/hooks/useDynamicWaas/useDynamicWaas.cjs');
|
|
80
|
+
var useRefreshUser = require('../../utils/hooks/useRefreshUser/useRefreshUser.cjs');
|
|
80
81
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
81
82
|
require('formik');
|
|
82
83
|
require('../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
|
|
@@ -103,7 +104,6 @@ require('../MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.cjs');
|
|
|
103
104
|
require('../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
104
105
|
require('../../store/state/tokenBalances.cjs');
|
|
105
106
|
require('../../store/state/multichainBalances.cjs');
|
|
106
|
-
var useRefreshUser = require('../../utils/hooks/useRefreshUser/useRefreshUser.cjs');
|
|
107
107
|
require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
108
108
|
var EmbeddedWalletExport = require('../../components/EmbeddedWalletExport/EmbeddedWalletExport.cjs');
|
|
109
109
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
@@ -73,6 +73,7 @@ import '../../components/IconButton/IconButton.js';
|
|
|
73
73
|
import { ModalHeader } from '../../components/ModalHeader/ModalHeader.js';
|
|
74
74
|
import { TypographyButton } from '../../components/TypographyButton/TypographyButton.js';
|
|
75
75
|
import { useDynamicWaas } from '../../utils/hooks/useDynamicWaas/useDynamicWaas.js';
|
|
76
|
+
import { useRefreshUser } from '../../utils/hooks/useRefreshUser/useRefreshUser.js';
|
|
76
77
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
77
78
|
import 'formik';
|
|
78
79
|
import '../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
|
|
@@ -99,7 +100,6 @@ import '../MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.js';
|
|
|
99
100
|
import '../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
100
101
|
import '../../store/state/tokenBalances.js';
|
|
101
102
|
import '../../store/state/multichainBalances.js';
|
|
102
|
-
import { useRefreshUser } from '../../utils/hooks/useRefreshUser/useRefreshUser.js';
|
|
103
103
|
import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
104
104
|
import { EmbeddedWalletExport } from '../../components/EmbeddedWalletExport/EmbeddedWalletExport.js';
|
|
105
105
|
import '../../components/InlineWidget/InlineWidget.js';
|