@dynamic-labs/sdk-react-core 4.59.2 → 4.60.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/package.cjs +4 -3
- package/package.js +4 -3
- package/package.json +15 -14
- package/src/index.cjs +6 -4
- package/src/index.d.ts +1 -1
- package/src/index.js +3 -2
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/events/embeddedWallet.d.ts +15 -3
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +2 -1
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +2 -1
- package/src/lib/shared/assets/{warning-circle-orange.cjs → error-circle-x.cjs} +12 -15
- package/src/lib/shared/assets/{warning-circle-orange.js → error-circle-x.js} +12 -15
- package/src/lib/shared/assets/index.d.ts +2 -1
- package/src/lib/shared/assets/setup-password-terms-illustration.cjs +83 -0
- package/src/lib/shared/assets/setup-password-terms-illustration.js +59 -0
- package/src/lib/shared/types/dynamicHandlers.d.ts +64 -0
- package/src/lib/shared/utils/functions/chain/getChainIcon.cjs +1 -0
- package/src/lib/shared/utils/functions/chain/getChainIcon.js +2 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/index.d.ts +4 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +27 -9
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +3 -2
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +27 -9
- package/src/lib/utils/hooks/useGetWalletPassword/index.d.ts +2 -0
- package/src/lib/utils/hooks/useGetWalletPassword/useGetWalletPassword.cjs +130 -0
- package/src/lib/utils/hooks/useGetWalletPassword/useGetWalletPassword.d.ts +6 -0
- package/src/lib/utils/hooks/useGetWalletPassword/useGetWalletPassword.js +126 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/index.d.ts +2 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/usePromptWalletUnlock.cjs +144 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/usePromptWalletUnlock.d.ts +5 -0
- package/src/lib/utils/hooks/usePromptWalletUnlock/usePromptWalletUnlock.js +140 -0
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +15 -15
- package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +15 -15
- package/src/lib/utils/hooks/useSetupPassword/useSetupPassword.cjs +25 -25
- package/src/lib/utils/hooks/useSetupPassword/useSetupPassword.d.ts +3 -0
- package/src/lib/utils/hooks/useSetupPassword/useSetupPassword.js +26 -26
- package/src/lib/utils/hooks/useSmartWallets/useSmartWallets.cjs +1 -1
- package/src/lib/utils/hooks/useSmartWallets/useSmartWallets.js +1 -1
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +1 -1
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +1 -1
- package/src/lib/utils/hooks/useWalletBackup/useWalletBackup.cjs +1 -1
- package/src/lib/utils/hooks/useWalletBackup/useWalletBackup.js +1 -1
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.cjs +1 -1
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.js +1 -1
- package/src/lib/utils/hooks/useWalletUnlock/index.d.ts +2 -0
- package/src/lib/utils/hooks/useWalletUnlock/useWalletUnlock.d.ts +15 -0
- package/src/lib/views/NoAccess/NoAccess.cjs +1 -1
- package/src/lib/views/NoAccess/NoAccess.js +1 -1
- package/src/lib/views/{SetupPasswordForWalletCreationView/SetupPasswordForWalletCreationView.cjs → UnlockWalletView/UnlockWalletView.cjs} +49 -13
- package/src/lib/views/UnlockWalletView/UnlockWalletView.d.ts +6 -0
- package/src/lib/views/{SetupPasswordForWalletCreationView/SetupPasswordForWalletCreationView.js → UnlockWalletView/UnlockWalletView.js} +49 -13
- package/src/lib/views/UnlockWalletView/index.d.ts +2 -0
- package/src/lib/views/index.d.ts +3 -3
- package/src/lib/views/viewToComponentMap.cjs +3 -3
- package/src/lib/views/viewToComponentMap.d.ts +1 -1
- package/src/lib/views/viewToComponentMap.js +3 -3
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.cjs +43 -43
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/mapViewToComponent.js +43 -43
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.cjs +33 -19
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/MfaSection/MfaSection.js +33 -19
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/EnterPasswordView.cjs +71 -0
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/EnterPasswordView.d.ts +9 -0
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/EnterPasswordView.js +67 -0
- package/src/lib/widgets/DynamicWidget/views/EnterPasswordView/index.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordKnowledgeCheckView/SetupPasswordKnowledgeCheckView.cjs +7 -15
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordKnowledgeCheckView/SetupPasswordKnowledgeCheckView.d.ts +0 -1
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordKnowledgeCheckView/SetupPasswordKnowledgeCheckView.js +7 -15
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordTermsView/SetupPasswordTermsView.cjs +10 -4
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordTermsView/SetupPasswordTermsView.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordTermsView/SetupPasswordTermsView.js +10 -4
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordView/SetupPasswordView.cjs +15 -11
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordView/SetupPasswordView.js +15 -11
- package/src/lib/widgets/DynamicWidget/views/index.d.ts +1 -0
- package/src/lib/views/SetupPasswordForWalletCreationView/SetupPasswordForWalletCreationView.d.ts +0 -2
- package/src/lib/views/SetupPasswordForWalletCreationView/index.d.ts +0 -1
|
@@ -100,3 +100,7 @@ export { CloudBackupProvider, isWalletBackedUp, useBackupWallets, useWalletBacku
|
|
|
100
100
|
export type { WalletBackupStatus, WalletOperationState, WalletToBackup, WalletWithBackupStatus, } from './useWalletBackup';
|
|
101
101
|
export { useRefreshAuth } from './useRefreshAuth';
|
|
102
102
|
export { useSetupPassword, PASSWORD_SETUP_CANCELLED_ERROR, } from './useSetupPassword';
|
|
103
|
+
export { useWalletUnlock } from './useWalletUnlock';
|
|
104
|
+
export type { UseWalletUnlockReturn, WalletUnlockState, } from './useWalletUnlock';
|
|
105
|
+
export { usePromptWalletUnlock } from './usePromptWalletUnlock';
|
|
106
|
+
export { useGetWalletPassword } from './useGetWalletPassword';
|
|
@@ -86,6 +86,13 @@ require('qrcode');
|
|
|
86
86
|
require('formik');
|
|
87
87
|
require('../useSubdomainCheck/useSubdomainCheck.cjs');
|
|
88
88
|
require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
89
|
+
var apiUrl = require('../../constants/waas/apiUrl.cjs');
|
|
90
|
+
var useClientSessionKeys = require('../useClientSessionKeys/useClientSessionKeys.cjs');
|
|
91
|
+
var useGetMfaToken = require('../useGetMfaToken/useGetMfaToken.cjs');
|
|
92
|
+
var useGetWalletPassword = require('../useGetWalletPassword/useGetWalletPassword.cjs');
|
|
93
|
+
var useRefreshAuth = require('../useRefreshAuth/useRefreshAuth.cjs');
|
|
94
|
+
var constants = require('./constants.cjs');
|
|
95
|
+
var normalizeWalletRequirements = require('./normalizeWalletRequirements.cjs');
|
|
89
96
|
require('../useWalletBackup/useWalletBackup.cjs');
|
|
90
97
|
require('../useWalletBackup/types.cjs');
|
|
91
98
|
require('../useWalletBackup/cloudProviders.cjs');
|
|
@@ -101,12 +108,6 @@ require('../../../context/FooterAnimationContext/index.cjs');
|
|
|
101
108
|
require('../../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.cjs');
|
|
102
109
|
require('../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
103
110
|
require('../../../context/OnrampContext/OnrampContext.cjs');
|
|
104
|
-
var useRefreshAuth = require('../useRefreshAuth/useRefreshAuth.cjs');
|
|
105
|
-
var apiUrl = require('../../constants/waas/apiUrl.cjs');
|
|
106
|
-
var useClientSessionKeys = require('../useClientSessionKeys/useClientSessionKeys.cjs');
|
|
107
|
-
var useGetMfaToken = require('../useGetMfaToken/useGetMfaToken.cjs');
|
|
108
|
-
var constants = require('./constants.cjs');
|
|
109
|
-
var normalizeWalletRequirements = require('./normalizeWalletRequirements.cjs');
|
|
110
111
|
require('../../../store/state/sendBalances.cjs');
|
|
111
112
|
require('../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
112
113
|
require('../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
@@ -122,7 +123,7 @@ require('../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
122
123
|
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
123
124
|
|
|
124
125
|
const dynamicWaasKey = 'dynamicwaas';
|
|
125
|
-
const configWaasWalletConnector = ({ walletConnector, environmentId, apiBaseUrl, relayUrl, baseClientKeysharesRelayApiUrl, authMode = 'header', getSignedSessionId, getMfaToken, svmGasSponsorshipEnabled = false, }) => {
|
|
126
|
+
const configWaasWalletConnector = ({ walletConnector, environmentId, apiBaseUrl, relayUrl, baseClientKeysharesRelayApiUrl, authMode = 'header', getSignedSessionId, getMfaToken, getWalletPassword, svmGasSponsorshipEnabled = false, }) => {
|
|
126
127
|
var _a;
|
|
127
128
|
walletConnector.setEnvironmentId(environmentId);
|
|
128
129
|
walletConnector.setBaseApiUrl((_a = (apiBaseUrl || apiUrl.DEFAULT_WAAS_API_URL)) === null || _a === void 0 ? void 0 : _a.replace('/api/v0', ''));
|
|
@@ -138,6 +139,10 @@ const configWaasWalletConnector = ({ walletConnector, environmentId, apiBaseUrl,
|
|
|
138
139
|
walletConnector.setRelayUrl(relayUrl);
|
|
139
140
|
walletConnector.setGetMfaTokenFunction(getMfaToken);
|
|
140
141
|
walletConnector.setBaseClientKeysharesRelayApiUrl(baseClientKeysharesRelayApiUrl);
|
|
142
|
+
// Set password provider for locked wallets
|
|
143
|
+
if (getWalletPassword) {
|
|
144
|
+
walletConnector.setGetWalletPasswordFunction(getWalletPassword);
|
|
145
|
+
}
|
|
141
146
|
// Sync SVM gas sponsorship setting for SOL connectors
|
|
142
147
|
const isSolConnector = walletConnector.connectedChain === 'SOL';
|
|
143
148
|
const supportsSponsorshipSetting = 'setSvmGasSponsorshipEnabled' in walletConnector;
|
|
@@ -170,6 +175,7 @@ const useDynamicWaas = () => {
|
|
|
170
175
|
const authToken = getMinAuthToken.getMinAuthToken();
|
|
171
176
|
const { getSignedSessionId } = useClientSessionKeys.useClientSessionKeys();
|
|
172
177
|
const getMfaToken = useGetMfaToken.useGetMfaToken();
|
|
178
|
+
const getWalletPassword = useGetWalletPassword.useGetWalletPassword();
|
|
173
179
|
const isCookieAuthEnabled = projectSettings && isCookieEnabled.isCookieEnabled();
|
|
174
180
|
const isUpgrading = React.useRef(false);
|
|
175
181
|
const [recoveredWallets, setRecoveredWallets] = React.useState(() => new Set());
|
|
@@ -192,6 +198,7 @@ const useDynamicWaas = () => {
|
|
|
192
198
|
environmentId,
|
|
193
199
|
getMfaToken,
|
|
194
200
|
getSignedSessionId,
|
|
201
|
+
getWalletPassword,
|
|
195
202
|
relayUrl: relayUrl !== null && relayUrl !== void 0 ? relayUrl : '',
|
|
196
203
|
svmGasSponsorshipEnabled,
|
|
197
204
|
walletConnector,
|
|
@@ -204,6 +211,7 @@ const useDynamicWaas = () => {
|
|
|
204
211
|
environmentId,
|
|
205
212
|
apiBaseUrl,
|
|
206
213
|
getMfaToken,
|
|
214
|
+
getWalletPassword,
|
|
207
215
|
getSignedSessionId,
|
|
208
216
|
relayUrl,
|
|
209
217
|
baseClientKeysharesRelayApiUrl,
|
|
@@ -233,14 +241,23 @@ const useDynamicWaas = () => {
|
|
|
233
241
|
return;
|
|
234
242
|
try {
|
|
235
243
|
const initializationStart = new Date().getTime();
|
|
236
|
-
|
|
244
|
+
const userWaasWallets = user.verifiedCredentials.filter((vc) => vc.walletName === dynamicWaasKey && vc.address && vc.chain);
|
|
245
|
+
const chainsWithWallets = [
|
|
246
|
+
...new Set(userWaasWallets.map((vc) => { var _a; return values.VerifiedCredentialNameToChainEnum[(_a = vc.chain) !== null && _a !== void 0 ? _a : '']; })),
|
|
247
|
+
].filter(Boolean);
|
|
248
|
+
// Combine enabled chains with chains that have wallets
|
|
249
|
+
// This ensures we initialize clients for enabled chains AND recover wallets from any other chains
|
|
250
|
+
const allChainsToProcess = [
|
|
251
|
+
...new Set([...(enabledChainNames || []), ...chainsWithWallets]),
|
|
252
|
+
];
|
|
253
|
+
yield Promise.all(allChainsToProcess.map((chain) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
237
254
|
const walletConnector = getWaasWalletConnector(chain);
|
|
238
255
|
if (!walletConnector)
|
|
239
256
|
return;
|
|
240
257
|
// Filter for waas wallets on this chain
|
|
241
258
|
const waasWallets = user.verifiedCredentials.filter((credential) => {
|
|
242
259
|
var _a;
|
|
243
|
-
return credential.walletName ===
|
|
260
|
+
return credential.walletName === dynamicWaasKey &&
|
|
244
261
|
credential.address &&
|
|
245
262
|
values.VerifiedCredentialNameToChainEnum[(_a = credential.chain) !== null && _a !== void 0 ? _a : ''] ===
|
|
246
263
|
walletConnector.connectedChain;
|
|
@@ -276,6 +293,7 @@ const useDynamicWaas = () => {
|
|
|
276
293
|
const signedSessionId = yield getSignedSessionId();
|
|
277
294
|
yield client.getWallet({
|
|
278
295
|
accountAddress: wallet.address,
|
|
296
|
+
authToken: getMinAuthToken.getMinAuthToken(),
|
|
279
297
|
signedSessionId,
|
|
280
298
|
walletOperation: 'RECOVER',
|
|
281
299
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChainEnum, MFAAction } from '@dynamic-labs/sdk-api-core';
|
|
2
|
-
import { IDynamicWaasConnector, Wallet, WalletConnectorCore } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
+
import { GetWalletPasswordFn, IDynamicWaasConnector, Wallet, WalletConnectorCore } from '@dynamic-labs/wallet-connector-core';
|
|
3
3
|
/**
|
|
4
4
|
* Type for wallet creation requirements
|
|
5
5
|
* For BTC: includes bitcoinConfig with addressType
|
|
@@ -12,7 +12,7 @@ export type WalletCreationRequirement = {
|
|
|
12
12
|
network?: string;
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
|
-
export declare const configWaasWalletConnector: ({ walletConnector, environmentId, apiBaseUrl, relayUrl, baseClientKeysharesRelayApiUrl, authMode, getSignedSessionId, getMfaToken, svmGasSponsorshipEnabled, }: {
|
|
15
|
+
export declare const configWaasWalletConnector: ({ walletConnector, environmentId, apiBaseUrl, relayUrl, baseClientKeysharesRelayApiUrl, authMode, getSignedSessionId, getMfaToken, getWalletPassword, svmGasSponsorshipEnabled, }: {
|
|
16
16
|
walletConnector: IDynamicWaasConnector;
|
|
17
17
|
environmentId: string;
|
|
18
18
|
apiBaseUrl: string;
|
|
@@ -23,6 +23,7 @@ export declare const configWaasWalletConnector: ({ walletConnector, environmentI
|
|
|
23
23
|
getMfaToken: (props?: {
|
|
24
24
|
mfaAction?: MFAAction;
|
|
25
25
|
}) => Promise<string | undefined>;
|
|
26
|
+
getWalletPassword?: GetWalletPasswordFn;
|
|
26
27
|
svmGasSponsorshipEnabled?: boolean;
|
|
27
28
|
}) => IDynamicWaasConnector;
|
|
28
29
|
export declare const useDynamicWaas: () => {
|
|
@@ -82,6 +82,13 @@ import 'qrcode';
|
|
|
82
82
|
import 'formik';
|
|
83
83
|
import '../useSubdomainCheck/useSubdomainCheck.js';
|
|
84
84
|
import '../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
85
|
+
import { DEFAULT_WAAS_API_URL } from '../../constants/waas/apiUrl.js';
|
|
86
|
+
import { useClientSessionKeys } from '../useClientSessionKeys/useClientSessionKeys.js';
|
|
87
|
+
import { useGetMfaToken } from '../useGetMfaToken/useGetMfaToken.js';
|
|
88
|
+
import { useGetWalletPassword } from '../useGetWalletPassword/useGetWalletPassword.js';
|
|
89
|
+
import { useRefreshAuth } from '../useRefreshAuth/useRefreshAuth.js';
|
|
90
|
+
import { DYNAMIC_WAAS_CONNECTOR_NOT_FOUND_ERROR, NO_ENABLED_CHAINS_ERROR, INVALID_CHAINS_ERROR, WALLET_CREATION_FAILED_ERROR } from './constants.js';
|
|
91
|
+
import { normalizeWalletRequirements } from './normalizeWalletRequirements.js';
|
|
85
92
|
import '../useWalletBackup/useWalletBackup.js';
|
|
86
93
|
import '../useWalletBackup/types.js';
|
|
87
94
|
import '../useWalletBackup/cloudProviders.js';
|
|
@@ -97,12 +104,6 @@ import '../../../context/FooterAnimationContext/index.js';
|
|
|
97
104
|
import '../../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.js';
|
|
98
105
|
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
99
106
|
import '../../../context/OnrampContext/OnrampContext.js';
|
|
100
|
-
import { useRefreshAuth } from '../useRefreshAuth/useRefreshAuth.js';
|
|
101
|
-
import { DEFAULT_WAAS_API_URL } from '../../constants/waas/apiUrl.js';
|
|
102
|
-
import { useClientSessionKeys } from '../useClientSessionKeys/useClientSessionKeys.js';
|
|
103
|
-
import { useGetMfaToken } from '../useGetMfaToken/useGetMfaToken.js';
|
|
104
|
-
import { DYNAMIC_WAAS_CONNECTOR_NOT_FOUND_ERROR, NO_ENABLED_CHAINS_ERROR, INVALID_CHAINS_ERROR, WALLET_CREATION_FAILED_ERROR } from './constants.js';
|
|
105
|
-
import { normalizeWalletRequirements } from './normalizeWalletRequirements.js';
|
|
106
107
|
import '../../../store/state/sendBalances.js';
|
|
107
108
|
import '../../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
108
109
|
import '../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
@@ -118,7 +119,7 @@ import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
118
119
|
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
119
120
|
|
|
120
121
|
const dynamicWaasKey = 'dynamicwaas';
|
|
121
|
-
const configWaasWalletConnector = ({ walletConnector, environmentId, apiBaseUrl, relayUrl, baseClientKeysharesRelayApiUrl, authMode = 'header', getSignedSessionId, getMfaToken, svmGasSponsorshipEnabled = false, }) => {
|
|
122
|
+
const configWaasWalletConnector = ({ walletConnector, environmentId, apiBaseUrl, relayUrl, baseClientKeysharesRelayApiUrl, authMode = 'header', getSignedSessionId, getMfaToken, getWalletPassword, svmGasSponsorshipEnabled = false, }) => {
|
|
122
123
|
var _a;
|
|
123
124
|
walletConnector.setEnvironmentId(environmentId);
|
|
124
125
|
walletConnector.setBaseApiUrl((_a = (apiBaseUrl || DEFAULT_WAAS_API_URL)) === null || _a === void 0 ? void 0 : _a.replace('/api/v0', ''));
|
|
@@ -134,6 +135,10 @@ const configWaasWalletConnector = ({ walletConnector, environmentId, apiBaseUrl,
|
|
|
134
135
|
walletConnector.setRelayUrl(relayUrl);
|
|
135
136
|
walletConnector.setGetMfaTokenFunction(getMfaToken);
|
|
136
137
|
walletConnector.setBaseClientKeysharesRelayApiUrl(baseClientKeysharesRelayApiUrl);
|
|
138
|
+
// Set password provider for locked wallets
|
|
139
|
+
if (getWalletPassword) {
|
|
140
|
+
walletConnector.setGetWalletPasswordFunction(getWalletPassword);
|
|
141
|
+
}
|
|
137
142
|
// Sync SVM gas sponsorship setting for SOL connectors
|
|
138
143
|
const isSolConnector = walletConnector.connectedChain === 'SOL';
|
|
139
144
|
const supportsSponsorshipSetting = 'setSvmGasSponsorshipEnabled' in walletConnector;
|
|
@@ -166,6 +171,7 @@ const useDynamicWaas = () => {
|
|
|
166
171
|
const authToken = getMinAuthToken();
|
|
167
172
|
const { getSignedSessionId } = useClientSessionKeys();
|
|
168
173
|
const getMfaToken = useGetMfaToken();
|
|
174
|
+
const getWalletPassword = useGetWalletPassword();
|
|
169
175
|
const isCookieAuthEnabled = projectSettings && isCookieEnabled();
|
|
170
176
|
const isUpgrading = useRef(false);
|
|
171
177
|
const [recoveredWallets, setRecoveredWallets] = useState(() => new Set());
|
|
@@ -188,6 +194,7 @@ const useDynamicWaas = () => {
|
|
|
188
194
|
environmentId,
|
|
189
195
|
getMfaToken,
|
|
190
196
|
getSignedSessionId,
|
|
197
|
+
getWalletPassword,
|
|
191
198
|
relayUrl: relayUrl !== null && relayUrl !== void 0 ? relayUrl : '',
|
|
192
199
|
svmGasSponsorshipEnabled,
|
|
193
200
|
walletConnector,
|
|
@@ -200,6 +207,7 @@ const useDynamicWaas = () => {
|
|
|
200
207
|
environmentId,
|
|
201
208
|
apiBaseUrl,
|
|
202
209
|
getMfaToken,
|
|
210
|
+
getWalletPassword,
|
|
203
211
|
getSignedSessionId,
|
|
204
212
|
relayUrl,
|
|
205
213
|
baseClientKeysharesRelayApiUrl,
|
|
@@ -229,14 +237,23 @@ const useDynamicWaas = () => {
|
|
|
229
237
|
return;
|
|
230
238
|
try {
|
|
231
239
|
const initializationStart = new Date().getTime();
|
|
232
|
-
|
|
240
|
+
const userWaasWallets = user.verifiedCredentials.filter((vc) => vc.walletName === dynamicWaasKey && vc.address && vc.chain);
|
|
241
|
+
const chainsWithWallets = [
|
|
242
|
+
...new Set(userWaasWallets.map((vc) => { var _a; return VerifiedCredentialNameToChainEnum[(_a = vc.chain) !== null && _a !== void 0 ? _a : '']; })),
|
|
243
|
+
].filter(Boolean);
|
|
244
|
+
// Combine enabled chains with chains that have wallets
|
|
245
|
+
// This ensures we initialize clients for enabled chains AND recover wallets from any other chains
|
|
246
|
+
const allChainsToProcess = [
|
|
247
|
+
...new Set([...(enabledChainNames || []), ...chainsWithWallets]),
|
|
248
|
+
];
|
|
249
|
+
yield Promise.all(allChainsToProcess.map((chain) => __awaiter(void 0, void 0, void 0, function* () {
|
|
233
250
|
const walletConnector = getWaasWalletConnector(chain);
|
|
234
251
|
if (!walletConnector)
|
|
235
252
|
return;
|
|
236
253
|
// Filter for waas wallets on this chain
|
|
237
254
|
const waasWallets = user.verifiedCredentials.filter((credential) => {
|
|
238
255
|
var _a;
|
|
239
|
-
return credential.walletName ===
|
|
256
|
+
return credential.walletName === dynamicWaasKey &&
|
|
240
257
|
credential.address &&
|
|
241
258
|
VerifiedCredentialNameToChainEnum[(_a = credential.chain) !== null && _a !== void 0 ? _a : ''] ===
|
|
242
259
|
walletConnector.connectedChain;
|
|
@@ -272,6 +289,7 @@ const useDynamicWaas = () => {
|
|
|
272
289
|
const signedSessionId = yield getSignedSessionId();
|
|
273
290
|
yield client.getWallet({
|
|
274
291
|
accountAddress: wallet.address,
|
|
292
|
+
authToken: getMinAuthToken(),
|
|
275
293
|
signedSessionId,
|
|
276
294
|
walletOperation: 'RECOVER',
|
|
277
295
|
});
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
9
|
+
require('../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
10
|
+
require('@dynamic-labs/iconic');
|
|
11
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
12
|
+
require('react/jsx-runtime');
|
|
13
|
+
require('../../../context/ViewContext/ViewContext.cjs');
|
|
14
|
+
require('../../../shared/logger.cjs');
|
|
15
|
+
require('@dynamic-labs/wallet-book');
|
|
16
|
+
require('@dynamic-labs/utils');
|
|
17
|
+
require('../../constants/colors.cjs');
|
|
18
|
+
require('../../constants/values.cjs');
|
|
19
|
+
require('@dynamic-labs/sdk-api-core');
|
|
20
|
+
require('../../../shared/consts/index.cjs');
|
|
21
|
+
require('../../../events/dynamicEvents.cjs');
|
|
22
|
+
require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
23
|
+
require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
24
|
+
require('@dynamic-labs/multi-wallet');
|
|
25
|
+
require('react-international-phone');
|
|
26
|
+
require('../../../store/state/nonce/nonce.cjs');
|
|
27
|
+
require('@dynamic-labs-sdk/client/core');
|
|
28
|
+
require('../../../client/client.cjs');
|
|
29
|
+
require('@dynamic-labs-sdk/client');
|
|
30
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
31
|
+
require('@dynamic-labs/locale');
|
|
32
|
+
require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
|
|
33
|
+
require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
|
|
34
|
+
require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
35
|
+
require('../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.cjs');
|
|
36
|
+
require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
37
|
+
require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
38
|
+
require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
39
|
+
require('../../../store/state/authMode/authMode.cjs');
|
|
40
|
+
require('../../../context/VerificationContext/VerificationContext.cjs');
|
|
41
|
+
require('react-dom');
|
|
42
|
+
require('../../functions/compareChains/compareChains.cjs');
|
|
43
|
+
require('../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
|
|
44
|
+
require('../../../context/ThemeContext/ThemeContext.cjs');
|
|
45
|
+
require('../useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
|
|
46
|
+
require('bs58');
|
|
47
|
+
require('@dynamic-labs/types');
|
|
48
|
+
require('../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
49
|
+
require('../../../context/LoadingContext/LoadingContext.cjs');
|
|
50
|
+
require('../../../context/WalletContext/WalletContext.cjs');
|
|
51
|
+
require('../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
52
|
+
require('yup');
|
|
53
|
+
require('../../../context/MockContext/MockContext.cjs');
|
|
54
|
+
require('../../../views/CollectUserDataView/useFields.cjs');
|
|
55
|
+
require('../../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
56
|
+
require('../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
57
|
+
require('@dynamic-labs/rpc-providers');
|
|
58
|
+
require('../../../store/state/walletOptions/walletOptions.cjs');
|
|
59
|
+
require('react-i18next');
|
|
60
|
+
require('../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
61
|
+
require('../../../components/Alert/Alert.cjs');
|
|
62
|
+
require('../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
63
|
+
require('../../../components/IconButton/IconButton.cjs');
|
|
64
|
+
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
65
|
+
require('../../../components/Input/Input.cjs');
|
|
66
|
+
require('../../../components/IsBrowser/IsBrowser.cjs');
|
|
67
|
+
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
68
|
+
require('../../../components/OverlayCard/OverlayCard.cjs');
|
|
69
|
+
require('../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
70
|
+
require('../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
71
|
+
require('../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
72
|
+
require('../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
73
|
+
require('../../../components/Popper/Popper/Popper.cjs');
|
|
74
|
+
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
75
|
+
require('react-focus-lock');
|
|
76
|
+
require('qrcode');
|
|
77
|
+
require('formik');
|
|
78
|
+
require('../useSubdomainCheck/useSubdomainCheck.cjs');
|
|
79
|
+
require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
80
|
+
var usePromptWalletUnlock = require('../usePromptWalletUnlock/usePromptWalletUnlock.cjs');
|
|
81
|
+
require('../useWalletBackup/useWalletBackup.cjs');
|
|
82
|
+
require('../useWalletBackup/types.cjs');
|
|
83
|
+
require('../useWalletBackup/cloudProviders.cjs');
|
|
84
|
+
require('../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
|
|
85
|
+
require('../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
|
|
86
|
+
require('../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
87
|
+
require('@hcaptcha/react-hcaptcha');
|
|
88
|
+
require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
89
|
+
require('../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.cjs');
|
|
90
|
+
require('../../../views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.cjs');
|
|
91
|
+
require('../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
92
|
+
require('../../../context/FooterAnimationContext/index.cjs');
|
|
93
|
+
require('../../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.cjs');
|
|
94
|
+
require('../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
95
|
+
require('../../../context/OnrampContext/OnrampContext.cjs');
|
|
96
|
+
require('../../../store/state/sendBalances.cjs');
|
|
97
|
+
require('../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
98
|
+
require('../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
99
|
+
require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
100
|
+
require('../../../views/TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
101
|
+
require('../../../widgets/DynamicWidget/components/PasskeyCard/PasskeyCard.cjs');
|
|
102
|
+
require('../../../widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.cjs');
|
|
103
|
+
require('../../../../index.cjs');
|
|
104
|
+
require('../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
105
|
+
require('../../../store/state/tokenBalances.cjs');
|
|
106
|
+
require('../../../store/state/multichainBalances.cjs');
|
|
107
|
+
require('../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
108
|
+
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
109
|
+
|
|
110
|
+
const useGetWalletPassword = () => {
|
|
111
|
+
const { handlers } = useInternalDynamicContext.useInternalDynamicContext();
|
|
112
|
+
const promptWalletUnlock = usePromptWalletUnlock.usePromptWalletUnlock();
|
|
113
|
+
// Use ref pattern to avoid callback recreation when handlers change
|
|
114
|
+
const getWalletPasswordHandlerRef = React.useRef(handlers === null || handlers === void 0 ? void 0 : handlers.getWalletPassword);
|
|
115
|
+
getWalletPasswordHandlerRef.current = handlers === null || handlers === void 0 ? void 0 : handlers.getWalletPassword;
|
|
116
|
+
const getWalletPassword = React.useCallback((_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ accountAddress, chainName, }) {
|
|
117
|
+
// If custom handler provided, use it
|
|
118
|
+
if (getWalletPasswordHandlerRef.current) {
|
|
119
|
+
return getWalletPasswordHandlerRef.current({
|
|
120
|
+
accountAddress,
|
|
121
|
+
chainName,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
// Otherwise use default UI prompt
|
|
125
|
+
return promptWalletUnlock({ accountAddress, chainName });
|
|
126
|
+
}), [promptWalletUnlock]);
|
|
127
|
+
return getWalletPassword;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
exports.useGetWalletPassword = useGetWalletPassword;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
|
+
import { useRef, useCallback } from 'react';
|
|
4
|
+
import '../../../context/DynamicContext/DynamicContext.js';
|
|
5
|
+
import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
6
|
+
import '@dynamic-labs/iconic';
|
|
7
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
8
|
+
import 'react/jsx-runtime';
|
|
9
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
10
|
+
import '../../../shared/logger.js';
|
|
11
|
+
import '@dynamic-labs/wallet-book';
|
|
12
|
+
import '@dynamic-labs/utils';
|
|
13
|
+
import '../../constants/colors.js';
|
|
14
|
+
import '../../constants/values.js';
|
|
15
|
+
import '@dynamic-labs/sdk-api-core';
|
|
16
|
+
import '../../../shared/consts/index.js';
|
|
17
|
+
import '../../../events/dynamicEvents.js';
|
|
18
|
+
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
19
|
+
import '../../../context/ErrorContext/ErrorContext.js';
|
|
20
|
+
import '@dynamic-labs/multi-wallet';
|
|
21
|
+
import 'react-international-phone';
|
|
22
|
+
import '../../../store/state/nonce/nonce.js';
|
|
23
|
+
import '@dynamic-labs-sdk/client/core';
|
|
24
|
+
import '../../../client/client.js';
|
|
25
|
+
import '@dynamic-labs-sdk/client';
|
|
26
|
+
import '../../../config/ApiEndpoint.js';
|
|
27
|
+
import '@dynamic-labs/locale';
|
|
28
|
+
import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
|
|
29
|
+
import '../../../store/state/primaryWalletId/primaryWalletId.js';
|
|
30
|
+
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
31
|
+
import '../../functions/getWaasAddressTypeLabel/getWaasAddressTypeLabel.js';
|
|
32
|
+
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
33
|
+
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
34
|
+
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
35
|
+
import '../../../store/state/authMode/authMode.js';
|
|
36
|
+
import '../../../context/VerificationContext/VerificationContext.js';
|
|
37
|
+
import 'react-dom';
|
|
38
|
+
import '../../functions/compareChains/compareChains.js';
|
|
39
|
+
import '../../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
|
|
40
|
+
import '../../../context/ThemeContext/ThemeContext.js';
|
|
41
|
+
import '../useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
|
|
42
|
+
import 'bs58';
|
|
43
|
+
import '@dynamic-labs/types';
|
|
44
|
+
import '../../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
45
|
+
import '../../../context/LoadingContext/LoadingContext.js';
|
|
46
|
+
import '../../../context/WalletContext/WalletContext.js';
|
|
47
|
+
import '../useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
48
|
+
import 'yup';
|
|
49
|
+
import '../../../context/MockContext/MockContext.js';
|
|
50
|
+
import '../../../views/CollectUserDataView/useFields.js';
|
|
51
|
+
import '../../../context/FieldsStateContext/FieldsStateContext.js';
|
|
52
|
+
import '../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
53
|
+
import '@dynamic-labs/rpc-providers';
|
|
54
|
+
import '../../../store/state/walletOptions/walletOptions.js';
|
|
55
|
+
import 'react-i18next';
|
|
56
|
+
import '../../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
57
|
+
import '../../../components/Alert/Alert.js';
|
|
58
|
+
import '../../../components/ShadowDOM/ShadowDOM.js';
|
|
59
|
+
import '../../../components/IconButton/IconButton.js';
|
|
60
|
+
import '../../../components/InlineWidget/InlineWidget.js';
|
|
61
|
+
import '../../../components/Input/Input.js';
|
|
62
|
+
import '../../../components/IsBrowser/IsBrowser.js';
|
|
63
|
+
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
64
|
+
import '../../../components/OverlayCard/OverlayCard.js';
|
|
65
|
+
import '../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
66
|
+
import '../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
67
|
+
import '../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
68
|
+
import '../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
69
|
+
import '../../../components/Popper/Popper/Popper.js';
|
|
70
|
+
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
71
|
+
import 'react-focus-lock';
|
|
72
|
+
import 'qrcode';
|
|
73
|
+
import 'formik';
|
|
74
|
+
import '../useSubdomainCheck/useSubdomainCheck.js';
|
|
75
|
+
import '../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
76
|
+
import { usePromptWalletUnlock } from '../usePromptWalletUnlock/usePromptWalletUnlock.js';
|
|
77
|
+
import '../useWalletBackup/useWalletBackup.js';
|
|
78
|
+
import '../useWalletBackup/types.js';
|
|
79
|
+
import '../useWalletBackup/cloudProviders.js';
|
|
80
|
+
import '../../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
81
|
+
import '../../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
|
|
82
|
+
import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
83
|
+
import '@hcaptcha/react-hcaptcha';
|
|
84
|
+
import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
85
|
+
import '../../../widgets/DynamicWidget/helpers/convertExchangeKeyAndProviderEnum.js';
|
|
86
|
+
import '../../../views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.js';
|
|
87
|
+
import '../../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
|
|
88
|
+
import '../../../context/FooterAnimationContext/index.js';
|
|
89
|
+
import '../../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.js';
|
|
90
|
+
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
91
|
+
import '../../../context/OnrampContext/OnrampContext.js';
|
|
92
|
+
import '../../../store/state/sendBalances.js';
|
|
93
|
+
import '../../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
94
|
+
import '../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
95
|
+
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
96
|
+
import '../../../views/TransactionConfirmationView/TransactionConfirmationView.js';
|
|
97
|
+
import '../../../widgets/DynamicWidget/components/PasskeyCard/PasskeyCard.js';
|
|
98
|
+
import '../../../widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.js';
|
|
99
|
+
import '../../../../index.js';
|
|
100
|
+
import '../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
101
|
+
import '../../../store/state/tokenBalances.js';
|
|
102
|
+
import '../../../store/state/multichainBalances.js';
|
|
103
|
+
import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
104
|
+
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
105
|
+
|
|
106
|
+
const useGetWalletPassword = () => {
|
|
107
|
+
const { handlers } = useInternalDynamicContext();
|
|
108
|
+
const promptWalletUnlock = usePromptWalletUnlock();
|
|
109
|
+
// Use ref pattern to avoid callback recreation when handlers change
|
|
110
|
+
const getWalletPasswordHandlerRef = useRef(handlers === null || handlers === void 0 ? void 0 : handlers.getWalletPassword);
|
|
111
|
+
getWalletPasswordHandlerRef.current = handlers === null || handlers === void 0 ? void 0 : handlers.getWalletPassword;
|
|
112
|
+
const getWalletPassword = useCallback((_a) => __awaiter(void 0, [_a], void 0, function* ({ accountAddress, chainName, }) {
|
|
113
|
+
// If custom handler provided, use it
|
|
114
|
+
if (getWalletPasswordHandlerRef.current) {
|
|
115
|
+
return getWalletPasswordHandlerRef.current({
|
|
116
|
+
accountAddress,
|
|
117
|
+
chainName,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
// Otherwise use default UI prompt
|
|
121
|
+
return promptWalletUnlock({ accountAddress, chainName });
|
|
122
|
+
}), [promptWalletUnlock]);
|
|
123
|
+
return getWalletPassword;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export { useGetWalletPassword };
|