@dynamic-labs/sdk-react-core 4.65.0 → 4.66.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 +13 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +13 -13
- package/src/index.cjs +2 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -0
- package/src/lib/Main.cjs +1 -0
- package/src/lib/Main.js +1 -0
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +5 -2
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.d.ts +2 -0
- package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +5 -2
- package/src/lib/utils/hooks/useSignEip7702Authorization/index.d.ts +1 -0
- package/src/lib/utils/hooks/useSignEip7702Authorization/useSignEip7702Authorization.cjs +162 -0
- package/src/lib/utils/hooks/useSignEip7702Authorization/useSignEip7702Authorization.d.ts +78 -0
- package/src/lib/utils/hooks/useSignEip7702Authorization/useSignEip7702Authorization.js +158 -0
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +3 -1
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +3 -1
- package/src/lib/utils/hooks/useWalletPassword/useWalletPassword.cjs +24 -2
- package/src/lib/utils/hooks/useWalletPassword/useWalletPassword.js +24 -2
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.cjs +1 -1
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.js +1 -1
- package/src/lib/views/ResetPasswordForSettingsView/ResetPasswordForSettingsView.cjs +5 -21
- package/src/lib/views/ResetPasswordForSettingsView/ResetPasswordForSettingsView.js +5 -21
- package/src/lib/views/SetupPasswordForWalletCreationView/SetupPasswordForWalletCreationView.cjs +9 -1
- package/src/lib/views/SetupPasswordForWalletCreationView/SetupPasswordForWalletCreationView.js +9 -1
- package/src/lib/widgets/DynamicWidget/views/ResetPasswordView/ResetPasswordView.cjs +26 -5
- package/src/lib/widgets/DynamicWidget/views/ResetPasswordView/ResetPasswordView.js +26 -5
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordConfirmView/SetupPasswordConfirmView.cjs +3 -2
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordConfirmView/SetupPasswordConfirmView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordConfirmView/SetupPasswordConfirmView.js +3 -2
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordKnowledgeCheckView/SetupPasswordKnowledgeCheckView.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordKnowledgeCheckView/SetupPasswordKnowledgeCheckView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordKnowledgeCheckView/SetupPasswordKnowledgeCheckView.js +2 -2
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordView/SetupPasswordView.cjs +30 -22
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordView/SetupPasswordView.d.ts +2 -1
- package/src/lib/widgets/DynamicWidget/views/SetupPasswordView/SetupPasswordView.js +30 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.66.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.65.0...v4.66.0) (2026-03-02)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **stellar:** send serialized XDR for transaction signing ([#10548](https://github.com/dynamic-labs/dynamic-auth/issues/10548)) ([3ff6438](https://github.com/dynamic-labs/dynamic-auth/commit/3ff64384e16d5fdb32cd6a3fd144757bf05f4456))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* prevent MFA backup codes screen from being dismissed before acknowledgement ([#10530](https://github.com/dynamic-labs/dynamic-auth/issues/10530)) ([67086f0](https://github.com/dynamic-labs/dynamic-auth/commit/67086f0b4a1302d39853eb2eedcb6f5b8bfca889))
|
|
13
|
+
* **react-native:** add retry when setting items to secure store ([#10576](https://github.com/dynamic-labs/dynamic-auth/issues/10576)) ([22ea162](https://github.com/dynamic-labs/dynamic-auth/commit/22ea162420806a4a67394c99f3691754982a7f1f))
|
|
14
|
+
|
|
2
15
|
## [4.65.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.64.0...v4.65.0) (2026-02-27)
|
|
3
16
|
|
|
4
17
|
|
package/package.cjs
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var version = "4.
|
|
6
|
+
var version = "4.66.0";
|
|
7
7
|
var dependencies = {
|
|
8
8
|
"@dynamic-labs/sdk-api-core": "0.0.875",
|
|
9
9
|
"@dynamic-labs-sdk/client": "0.12.1",
|
|
10
|
-
"@dynamic-labs-wallet/browser-wallet-client": "0.0.
|
|
10
|
+
"@dynamic-labs-wallet/browser-wallet-client": "0.0.289",
|
|
11
11
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
12
12
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
13
13
|
"country-list": "2.3.0",
|
package/package.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
var version = "4.
|
|
2
|
+
var version = "4.66.0";
|
|
3
3
|
var dependencies = {
|
|
4
4
|
"@dynamic-labs/sdk-api-core": "0.0.875",
|
|
5
5
|
"@dynamic-labs-sdk/client": "0.12.1",
|
|
6
|
-
"@dynamic-labs-wallet/browser-wallet-client": "0.0.
|
|
6
|
+
"@dynamic-labs-wallet/browser-wallet-client": "0.0.289",
|
|
7
7
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
8
8
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
9
9
|
"country-list": "2.3.0",
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.66.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.875",
|
|
6
6
|
"@dynamic-labs-sdk/client": "0.12.1",
|
|
7
|
-
"@dynamic-labs-wallet/browser-wallet-client": "0.0.
|
|
7
|
+
"@dynamic-labs-wallet/browser-wallet-client": "0.0.289",
|
|
8
8
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
9
9
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
10
10
|
"country-list": "2.3.0",
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
"yup": "0.32.11",
|
|
17
17
|
"react-international-phone": "4.5.0",
|
|
18
18
|
"bs58": "5.0.0",
|
|
19
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
20
|
-
"@dynamic-labs/iconic": "4.
|
|
21
|
-
"@dynamic-labs/locale": "4.
|
|
22
|
-
"@dynamic-labs/logger": "4.
|
|
23
|
-
"@dynamic-labs/multi-wallet": "4.
|
|
24
|
-
"@dynamic-labs/rpc-providers": "4.
|
|
25
|
-
"@dynamic-labs/store": "4.
|
|
26
|
-
"@dynamic-labs/types": "4.
|
|
27
|
-
"@dynamic-labs/utils": "4.
|
|
28
|
-
"@dynamic-labs/wallet-book": "4.
|
|
29
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
19
|
+
"@dynamic-labs/assert-package-version": "4.66.0",
|
|
20
|
+
"@dynamic-labs/iconic": "4.66.0",
|
|
21
|
+
"@dynamic-labs/locale": "4.66.0",
|
|
22
|
+
"@dynamic-labs/logger": "4.66.0",
|
|
23
|
+
"@dynamic-labs/multi-wallet": "4.66.0",
|
|
24
|
+
"@dynamic-labs/rpc-providers": "4.66.0",
|
|
25
|
+
"@dynamic-labs/store": "4.66.0",
|
|
26
|
+
"@dynamic-labs/types": "4.66.0",
|
|
27
|
+
"@dynamic-labs/utils": "4.66.0",
|
|
28
|
+
"@dynamic-labs/wallet-book": "4.66.0",
|
|
29
|
+
"@dynamic-labs/wallet-connector-core": "4.66.0",
|
|
30
30
|
"eventemitter3": "5.0.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
package/src/index.cjs
CHANGED
|
@@ -169,6 +169,7 @@ var useExternalAuth = require('./lib/utils/hooks/useExternalAuth/useExternalAuth
|
|
|
169
169
|
var useRefreshUser = require('./lib/utils/hooks/useRefreshUser/useRefreshUser.cjs');
|
|
170
170
|
var useWalletOptions = require('./lib/utils/hooks/useWalletOptions/useWalletOptions.cjs');
|
|
171
171
|
var useSyncMfaFlow = require('./lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.cjs');
|
|
172
|
+
var useSignEip7702Authorization = require('./lib/utils/hooks/useSignEip7702Authorization/useSignEip7702Authorization.cjs');
|
|
172
173
|
var useTelegramLogin = require('./lib/utils/hooks/useTelegramLogin/useTelegramLogin.cjs');
|
|
173
174
|
var useUpgradeEmbeddedWallet = require('./lib/utils/hooks/useUpgradeEmbeddedWallet/useUpgradeEmbeddedWallet.cjs');
|
|
174
175
|
var useDeleteUserAccount = require('./lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.cjs');
|
|
@@ -333,6 +334,7 @@ exports.useExternalAuth = useExternalAuth.useExternalAuth;
|
|
|
333
334
|
exports.useRefreshUser = useRefreshUser.useRefreshUser;
|
|
334
335
|
exports.useWalletOptions = useWalletOptions.useWalletOptions;
|
|
335
336
|
exports.useSyncMfaFlow = useSyncMfaFlow.useSyncMfaFlow;
|
|
337
|
+
exports.useSignEip7702Authorization = useSignEip7702Authorization.useSignEip7702Authorization;
|
|
336
338
|
exports.useTelegramLogin = useTelegramLogin.useTelegramLogin;
|
|
337
339
|
exports.useUpgradeEmbeddedWallet = useUpgradeEmbeddedWallet.useUpgradeEmbeddedWallet;
|
|
338
340
|
exports.useDeleteUserAccount = useDeleteUserAccount.useDeleteUserAccount;
|
package/src/index.d.ts
CHANGED
|
@@ -123,7 +123,7 @@ export { FilterAndSortWallets, FilterBridgeChainsName, FilterChain, FilterWallet
|
|
|
123
123
|
export {
|
|
124
124
|
/** @deprecated */
|
|
125
125
|
DynamicWidgetContextProvider, } from './lib/widgets/DynamicWidget/context';
|
|
126
|
-
export { useWalletItemActions, useAuthenticateConnectedUser, useSocialAccounts, useEmbeddedWallet, useEmbeddedWalletAuthenticator, usePasskeyRecovery, useEmbeddedReveal, useIsLoggedIn, useDynamicModals, useMfa, useTokenBalances, useMultichainTokenBalances, useSwitchWallet, useRpcProviders, useRefreshUser, useRefreshAuth, useWalletOptions, useSmartWallets, EmbeddedWalletVersion, useTelegramLogin, useUpgradeEmbeddedWallet, useEVMTransactionSimulation, useSVMTransactionSimulation, useDeleteUserAccount, useDynamicWaas, useGetPasskeys, useDeletePasskey, useRegisterPasskey, useAuthenticatePasskeyMFA, useGetUserMfaMethods, usePromptMfaAuth, useUpgradeToDynamicWaasFlow, useGetMfaToken, useGetWalletPassword, useWalletPassword, useIsMfaRequiredForAction, useWalletDelegation, useWalletBackup, useBackupWallets, isWalletBackedUp, CloudBackupProvider, useExchangeAccounts, useStepUpAuthentication, } from './lib/utils/hooks';
|
|
126
|
+
export { useWalletItemActions, useAuthenticateConnectedUser, useSocialAccounts, useEmbeddedWallet, useEmbeddedWalletAuthenticator, usePasskeyRecovery, useEmbeddedReveal, useIsLoggedIn, useDynamicModals, useMfa, useTokenBalances, useMultichainTokenBalances, useSwitchWallet, useRpcProviders, useRefreshUser, useRefreshAuth, useWalletOptions, useSmartWallets, useSignEip7702Authorization, EmbeddedWalletVersion, useTelegramLogin, useUpgradeEmbeddedWallet, useEVMTransactionSimulation, useSVMTransactionSimulation, useDeleteUserAccount, useDynamicWaas, useGetPasskeys, useDeletePasskey, useRegisterPasskey, useAuthenticatePasskeyMFA, useGetUserMfaMethods, usePromptMfaAuth, useUpgradeToDynamicWaasFlow, useGetMfaToken, useGetWalletPassword, useWalletPassword, useIsMfaRequiredForAction, useWalletDelegation, useWalletBackup, useBackupWallets, isWalletBackedUp, CloudBackupProvider, useExchangeAccounts, useStepUpAuthentication, } from './lib/utils/hooks';
|
|
127
127
|
export type { StepUpAuthenticationState, UseStepUpAuthenticationParams, UseStepUpAuthenticationReturn, VerifyOtpParams, VerifyWalletParams, } from './lib/utils/hooks';
|
|
128
128
|
export {
|
|
129
129
|
/** @deprecated use useOnramp instead */
|
package/src/index.js
CHANGED
|
@@ -165,6 +165,7 @@ export { useExternalAuth } from './lib/utils/hooks/useExternalAuth/useExternalAu
|
|
|
165
165
|
export { useRefreshUser } from './lib/utils/hooks/useRefreshUser/useRefreshUser.js';
|
|
166
166
|
export { useWalletOptions } from './lib/utils/hooks/useWalletOptions/useWalletOptions.js';
|
|
167
167
|
export { useSyncMfaFlow } from './lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.js';
|
|
168
|
+
export { useSignEip7702Authorization } from './lib/utils/hooks/useSignEip7702Authorization/useSignEip7702Authorization.js';
|
|
168
169
|
export { useTelegramLogin } from './lib/utils/hooks/useTelegramLogin/useTelegramLogin.js';
|
|
169
170
|
export { useUpgradeEmbeddedWallet } from './lib/utils/hooks/useUpgradeEmbeddedWallet/useUpgradeEmbeddedWallet.js';
|
|
170
171
|
export { useDeleteUserAccount } from './lib/utils/hooks/useDeleteUserAccount/useDeleteUserAccount.js';
|
package/src/lib/Main.cjs
CHANGED
|
@@ -116,6 +116,7 @@ const viewsToDisableCloseOnOverlayClick = [
|
|
|
116
116
|
'social-redirect-view',
|
|
117
117
|
'passkey-intro',
|
|
118
118
|
'setup-password-for-wallet-creation',
|
|
119
|
+
'mfa-display-backup-codes',
|
|
119
120
|
];
|
|
120
121
|
const Main = () => {
|
|
121
122
|
const { selectedWalletConnector, linkedWallets, projectSettings, setShowAuthFlow, showAuthFlow, walletConnectorOptions, clearStatesOnBackClick, user, disconnectWallet, connectedWallets, handleLogOut, } = useInternalDynamicContext.useInternalDynamicContext();
|
package/src/lib/Main.js
CHANGED
|
@@ -112,6 +112,7 @@ const viewsToDisableCloseOnOverlayClick = [
|
|
|
112
112
|
'social-redirect-view',
|
|
113
113
|
'passkey-intro',
|
|
114
114
|
'setup-password-for-wallet-creation',
|
|
115
|
+
'mfa-display-backup-codes',
|
|
115
116
|
];
|
|
116
117
|
const Main = () => {
|
|
117
118
|
const { selectedWalletConnector, linkedWallets, projectSettings, setShowAuthFlow, showAuthFlow, walletConnectorOptions, clearStatesOnBackClick, user, disconnectWallet, connectedWallets, handleLogOut, } = useInternalDynamicContext();
|
|
@@ -65,6 +65,7 @@ export { useRefreshUser } from './useRefreshUser';
|
|
|
65
65
|
export { useWalletOptions } from './useWalletOptions';
|
|
66
66
|
export { useSyncMfaFlow } from './useSyncMfaFlow';
|
|
67
67
|
export * from './useSmartWallets';
|
|
68
|
+
export * from './useSignEip7702Authorization';
|
|
68
69
|
export { useEmbeddedWalletSessionKeys } from './useEmbeddedWalletSessionKeys';
|
|
69
70
|
export { useTelegramLogin } from './useTelegramLogin';
|
|
70
71
|
export { useEndUserWarning } from './useEndUserWarning';
|
|
@@ -368,7 +368,7 @@ const useDynamicWaas = () => {
|
|
|
368
368
|
]);
|
|
369
369
|
// If no chain names are provided, filter out chains that already have a wallet
|
|
370
370
|
// and make a wallet for each enabled chain
|
|
371
|
-
const createWalletAccount = React.useCallback((requirementsOrChainNames, password, bitcoinConfig) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
371
|
+
const createWalletAccount = React.useCallback((requirementsOrChainNames, password, bitcoinConfig, options) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
372
372
|
if (isUpgrading.current) {
|
|
373
373
|
return;
|
|
374
374
|
}
|
|
@@ -471,7 +471,10 @@ const useDynamicWaas = () => {
|
|
|
471
471
|
};
|
|
472
472
|
updatePrimaryWalletIfNeeded(primaryWalletAccount, refreshedUser);
|
|
473
473
|
}
|
|
474
|
-
|
|
474
|
+
// close email otp pin modal; skipped in password setup flow (done screen handles close)
|
|
475
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipCloseAuthFlow)) {
|
|
476
|
+
setShowAuthFlow(false, { performMultiWalletChecks: false });
|
|
477
|
+
}
|
|
475
478
|
return createdWalletAccounts;
|
|
476
479
|
}), [
|
|
477
480
|
getWaasWalletConnector,
|
|
@@ -35,6 +35,8 @@ export declare const useDynamicWaas: () => {
|
|
|
35
35
|
createWalletAccount: (requirementsOrChainNames: WalletCreationRequirement[] | ChainEnum[], password?: string, bitcoinConfig?: {
|
|
36
36
|
addressType?: string;
|
|
37
37
|
network?: string;
|
|
38
|
+
}, options?: {
|
|
39
|
+
skipCloseAuthFlow?: boolean;
|
|
38
40
|
}) => Promise<any[] | undefined>;
|
|
39
41
|
dynamicWaasIsEnabled: boolean;
|
|
40
42
|
getWaasWalletConnector: (chainName: string) => IDynamicWaasConnector | undefined;
|
|
@@ -364,7 +364,7 @@ const useDynamicWaas = () => {
|
|
|
364
364
|
]);
|
|
365
365
|
// If no chain names are provided, filter out chains that already have a wallet
|
|
366
366
|
// and make a wallet for each enabled chain
|
|
367
|
-
const createWalletAccount = useCallback((requirementsOrChainNames, password, bitcoinConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
367
|
+
const createWalletAccount = useCallback((requirementsOrChainNames, password, bitcoinConfig, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
368
368
|
if (isUpgrading.current) {
|
|
369
369
|
return;
|
|
370
370
|
}
|
|
@@ -467,7 +467,10 @@ const useDynamicWaas = () => {
|
|
|
467
467
|
};
|
|
468
468
|
updatePrimaryWalletIfNeeded(primaryWalletAccount, refreshedUser);
|
|
469
469
|
}
|
|
470
|
-
|
|
470
|
+
// close email otp pin modal; skipped in password setup flow (done screen handles close)
|
|
471
|
+
if (!(options === null || options === void 0 ? void 0 : options.skipCloseAuthFlow)) {
|
|
472
|
+
setShowAuthFlow(false, { performMultiWalletChecks: false });
|
|
473
|
+
}
|
|
471
474
|
return createdWalletAccounts;
|
|
472
475
|
}), [
|
|
473
476
|
getWaasWalletConnector,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useSignEip7702Authorization';
|
|
@@ -0,0 +1,162 @@
|
|
|
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
|
+
var utils = require('@dynamic-labs/utils');
|
|
9
|
+
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
10
|
+
require('../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
11
|
+
require('@dynamic-labs/iconic');
|
|
12
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
13
|
+
require('react/jsx-runtime');
|
|
14
|
+
require('../../../context/ViewContext/ViewContext.cjs');
|
|
15
|
+
require('../../../shared/logger.cjs');
|
|
16
|
+
require('@dynamic-labs/wallet-book');
|
|
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
|
+
require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.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/helpers/convertExchangeKeyAndProviderEnum.cjs');
|
|
89
|
+
require('../../../views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.cjs');
|
|
90
|
+
require('../../../context/ErrorContext/hooks/useErrorText/useErrorText.cjs');
|
|
91
|
+
require('../../../context/FooterAnimationContext/index.cjs');
|
|
92
|
+
require('../../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.cjs');
|
|
93
|
+
require('../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
94
|
+
require('../../../context/OnrampContext/OnrampContext.cjs');
|
|
95
|
+
require('../../../store/state/sendBalances.cjs');
|
|
96
|
+
require('../../../store/state/connectorsInitializing/connectorsInitializing.cjs');
|
|
97
|
+
require('../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
98
|
+
require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
99
|
+
require('../../../views/TransactionConfirmationView/TransactionConfirmationView.cjs');
|
|
100
|
+
require('../../../widgets/DynamicWidget/components/PasskeyCard/PasskeyCard.cjs');
|
|
101
|
+
require('../../../widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.cjs');
|
|
102
|
+
require('../../../../index.cjs');
|
|
103
|
+
require('../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.cjs');
|
|
104
|
+
require('../../../store/state/tokenBalances.cjs');
|
|
105
|
+
require('../../../store/state/multichainBalances.cjs');
|
|
106
|
+
require('../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
107
|
+
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.cjs');
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Hook for signing EIP-7702 authorizations for ZeroDev kernel delegation.
|
|
111
|
+
*
|
|
112
|
+
* This hook provides a way to sign EIP-7702 authorizations that enable
|
|
113
|
+
* single-use MFA flows where the authorization signing step is separated
|
|
114
|
+
* from the transaction execution step.
|
|
115
|
+
*
|
|
116
|
+
* The signed authorization can be passed to kernel account client creation
|
|
117
|
+
* functions like `createEcdsaKernelAccountClientWith7702`.
|
|
118
|
+
*
|
|
119
|
+
* @returns An object containing the `signEip7702Authorization` function
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```tsx
|
|
123
|
+
* import { useSignEip7702Authorization } from '@dynamic-labs/sdk-react-core';
|
|
124
|
+
*
|
|
125
|
+
* function MyComponent() {
|
|
126
|
+
* const { signEip7702Authorization } = useSignEip7702Authorization();
|
|
127
|
+
*
|
|
128
|
+
* const handleSign = async () => {
|
|
129
|
+
* try {
|
|
130
|
+
* const auth = await signEip7702Authorization();
|
|
131
|
+
* console.log('Signed authorization:', auth);
|
|
132
|
+
* // Use auth with kernel client creation
|
|
133
|
+
* } catch (error) {
|
|
134
|
+
* console.error('Failed to sign authorization:', error);
|
|
135
|
+
* }
|
|
136
|
+
* };
|
|
137
|
+
*
|
|
138
|
+
* return <button onClick={handleSign}>Sign Authorization</button>;
|
|
139
|
+
* }
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
const useSignEip7702Authorization = () => {
|
|
143
|
+
const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
144
|
+
const signEip7702Auth = React.useCallback((params) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
145
|
+
var _a;
|
|
146
|
+
const { wallet: providedWallet, chainId: providedChainId } = params !== null && params !== void 0 ? params : {};
|
|
147
|
+
// Use provided wallet or fallback to primary wallet
|
|
148
|
+
const wallet = providedWallet !== null && providedWallet !== void 0 ? providedWallet : primaryWallet;
|
|
149
|
+
if (!wallet) {
|
|
150
|
+
throw new utils.DynamicError('No wallet available. Please connect a wallet first.');
|
|
151
|
+
}
|
|
152
|
+
if (((_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.key) !== 'zerodev') {
|
|
153
|
+
throw new utils.DynamicError('The wallet connector must be a ZeroDev connector to sign EIP-7702 authorizations.');
|
|
154
|
+
}
|
|
155
|
+
return wallet.connector.signEip7702PreAuth(providedChainId);
|
|
156
|
+
}), [primaryWallet]);
|
|
157
|
+
return {
|
|
158
|
+
signEip7702Authorization: signEip7702Auth,
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
exports.useSignEip7702Authorization = useSignEip7702Authorization;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { IZeroDevConnector, Wallet } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
+
export type Eip7702Authorization = Awaited<ReturnType<IZeroDevConnector['signEip7702PreAuth']>>;
|
|
3
|
+
export type SignEip7702AuthorizationParams = {
|
|
4
|
+
/**
|
|
5
|
+
* The wallet to sign the EIP-7702 authorization with.
|
|
6
|
+
* If not provided, uses the primary wallet.
|
|
7
|
+
*/
|
|
8
|
+
wallet?: Wallet;
|
|
9
|
+
/**
|
|
10
|
+
* The chain ID to sign the authorization for.
|
|
11
|
+
* If not provided, uses the wallet's current network chain ID.
|
|
12
|
+
*/
|
|
13
|
+
chainId?: number;
|
|
14
|
+
};
|
|
15
|
+
export type UseSignEip7702AuthorizationReturn = {
|
|
16
|
+
/**
|
|
17
|
+
* Signs an EIP-7702 authorization for ZeroDev kernel delegation.
|
|
18
|
+
*
|
|
19
|
+
* This creates a signed authorization that allows a wallet to delegate
|
|
20
|
+
* its execution to the ZeroDev kernel contract. The signed authorization can then
|
|
21
|
+
* be passed to kernel account client creation functions.
|
|
22
|
+
*
|
|
23
|
+
* @param params - Optional parameters for signing the authorization
|
|
24
|
+
* @returns A promise that resolves to the signed EIP-7702 authorization
|
|
25
|
+
* @throws {DynamicError} If the wallet connector is not a ZeroDev connector
|
|
26
|
+
* @throws {DynamicError} If no wallet is available
|
|
27
|
+
* @throws {DynamicError} If the connector does not support EIP-7702 authorization
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* const { signEip7702Authorization } = useSignEip7702Authorization();
|
|
32
|
+
*
|
|
33
|
+
* // Sign with primary wallet and current network
|
|
34
|
+
* const auth = await signEip7702Authorization();
|
|
35
|
+
*
|
|
36
|
+
* // Sign with specific wallet and chain ID
|
|
37
|
+
* const auth = await signEip7702Authorization({
|
|
38
|
+
* wallet: myWallet,
|
|
39
|
+
* chainId: 1, // Ethereum mainnet
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
signEip7702Authorization: (params?: SignEip7702AuthorizationParams) => Promise<Eip7702Authorization>;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Hook for signing EIP-7702 authorizations for ZeroDev kernel delegation.
|
|
47
|
+
*
|
|
48
|
+
* This hook provides a way to sign EIP-7702 authorizations that enable
|
|
49
|
+
* single-use MFA flows where the authorization signing step is separated
|
|
50
|
+
* from the transaction execution step.
|
|
51
|
+
*
|
|
52
|
+
* The signed authorization can be passed to kernel account client creation
|
|
53
|
+
* functions like `createEcdsaKernelAccountClientWith7702`.
|
|
54
|
+
*
|
|
55
|
+
* @returns An object containing the `signEip7702Authorization` function
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* import { useSignEip7702Authorization } from '@dynamic-labs/sdk-react-core';
|
|
60
|
+
*
|
|
61
|
+
* function MyComponent() {
|
|
62
|
+
* const { signEip7702Authorization } = useSignEip7702Authorization();
|
|
63
|
+
*
|
|
64
|
+
* const handleSign = async () => {
|
|
65
|
+
* try {
|
|
66
|
+
* const auth = await signEip7702Authorization();
|
|
67
|
+
* console.log('Signed authorization:', auth);
|
|
68
|
+
* // Use auth with kernel client creation
|
|
69
|
+
* } catch (error) {
|
|
70
|
+
* console.error('Failed to sign authorization:', error);
|
|
71
|
+
* }
|
|
72
|
+
* };
|
|
73
|
+
*
|
|
74
|
+
* return <button onClick={handleSign}>Sign Authorization</button>;
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare const useSignEip7702Authorization: () => UseSignEip7702AuthorizationReturn;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { DynamicError } from '@dynamic-labs/utils';
|
|
5
|
+
import '../../../context/DynamicContext/DynamicContext.js';
|
|
6
|
+
import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
7
|
+
import '@dynamic-labs/iconic';
|
|
8
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
9
|
+
import 'react/jsx-runtime';
|
|
10
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
11
|
+
import '../../../shared/logger.js';
|
|
12
|
+
import '@dynamic-labs/wallet-book';
|
|
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 '../../../widgets/DynamicWidget/context/DynamicWidgetContext.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/helpers/convertExchangeKeyAndProviderEnum.js';
|
|
85
|
+
import '../../../views/ExchangeWhitelistWarning/ExchangeWhitelistWarning.js';
|
|
86
|
+
import '../../../context/ErrorContext/hooks/useErrorText/useErrorText.js';
|
|
87
|
+
import '../../../context/FooterAnimationContext/index.js';
|
|
88
|
+
import '../../../views/MfaChooseDeviceView/useGetMfaOptions/useGetMfaOptions.js';
|
|
89
|
+
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
90
|
+
import '../../../context/OnrampContext/OnrampContext.js';
|
|
91
|
+
import '../../../store/state/sendBalances.js';
|
|
92
|
+
import '../../../store/state/connectorsInitializing/connectorsInitializing.js';
|
|
93
|
+
import '../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
|
|
94
|
+
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
95
|
+
import '../../../views/TransactionConfirmationView/TransactionConfirmationView.js';
|
|
96
|
+
import '../../../widgets/DynamicWidget/components/PasskeyCard/PasskeyCard.js';
|
|
97
|
+
import '../../../widgets/DynamicWidget/views/CryptoComOnramp/CryptoComOnramp.js';
|
|
98
|
+
import '../../../../index.js';
|
|
99
|
+
import '../../../widgets/DynamicWidget/views/ReceiveWalletFunds/ReceiveWalletFunds.js';
|
|
100
|
+
import '../../../store/state/tokenBalances.js';
|
|
101
|
+
import '../../../store/state/multichainBalances.js';
|
|
102
|
+
import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
103
|
+
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext/useInternalDynamicContext.js';
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Hook for signing EIP-7702 authorizations for ZeroDev kernel delegation.
|
|
107
|
+
*
|
|
108
|
+
* This hook provides a way to sign EIP-7702 authorizations that enable
|
|
109
|
+
* single-use MFA flows where the authorization signing step is separated
|
|
110
|
+
* from the transaction execution step.
|
|
111
|
+
*
|
|
112
|
+
* The signed authorization can be passed to kernel account client creation
|
|
113
|
+
* functions like `createEcdsaKernelAccountClientWith7702`.
|
|
114
|
+
*
|
|
115
|
+
* @returns An object containing the `signEip7702Authorization` function
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```tsx
|
|
119
|
+
* import { useSignEip7702Authorization } from '@dynamic-labs/sdk-react-core';
|
|
120
|
+
*
|
|
121
|
+
* function MyComponent() {
|
|
122
|
+
* const { signEip7702Authorization } = useSignEip7702Authorization();
|
|
123
|
+
*
|
|
124
|
+
* const handleSign = async () => {
|
|
125
|
+
* try {
|
|
126
|
+
* const auth = await signEip7702Authorization();
|
|
127
|
+
* console.log('Signed authorization:', auth);
|
|
128
|
+
* // Use auth with kernel client creation
|
|
129
|
+
* } catch (error) {
|
|
130
|
+
* console.error('Failed to sign authorization:', error);
|
|
131
|
+
* }
|
|
132
|
+
* };
|
|
133
|
+
*
|
|
134
|
+
* return <button onClick={handleSign}>Sign Authorization</button>;
|
|
135
|
+
* }
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
const useSignEip7702Authorization = () => {
|
|
139
|
+
const { primaryWallet } = useInternalDynamicContext();
|
|
140
|
+
const signEip7702Auth = useCallback((params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
141
|
+
var _a;
|
|
142
|
+
const { wallet: providedWallet, chainId: providedChainId } = params !== null && params !== void 0 ? params : {};
|
|
143
|
+
// Use provided wallet or fallback to primary wallet
|
|
144
|
+
const wallet = providedWallet !== null && providedWallet !== void 0 ? providedWallet : primaryWallet;
|
|
145
|
+
if (!wallet) {
|
|
146
|
+
throw new DynamicError('No wallet available. Please connect a wallet first.');
|
|
147
|
+
}
|
|
148
|
+
if (((_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.key) !== 'zerodev') {
|
|
149
|
+
throw new DynamicError('The wallet connector must be a ZeroDev connector to sign EIP-7702 authorizations.');
|
|
150
|
+
}
|
|
151
|
+
return wallet.connector.signEip7702PreAuth(providedChainId);
|
|
152
|
+
}), [primaryWallet]);
|
|
153
|
+
return {
|
|
154
|
+
signEip7702Authorization: signEip7702Auth,
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export { useSignEip7702Authorization };
|
|
@@ -160,7 +160,9 @@ const useWalletCreation = () => {
|
|
|
160
160
|
try {
|
|
161
161
|
// If passcodeRequired is enabled, prompt user to set up password first
|
|
162
162
|
const password = yield setupPassword();
|
|
163
|
-
yield createWalletAccount(requirements, password
|
|
163
|
+
yield createWalletAccount(requirements, password, undefined, {
|
|
164
|
+
skipCloseAuthFlow: Boolean(password),
|
|
165
|
+
});
|
|
164
166
|
const duration = Date.now() - startTime;
|
|
165
167
|
// Log successful wallet creation to DataDog
|
|
166
168
|
logger.logger.instrument('Auto wallet creation successful', {
|