@dynamic-labs/sdk-react-core 4.16.0 → 4.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +13 -13
  5. package/src/lib/components/InlineSubmitButton/InlineSubmitButton.cjs +2 -2
  6. package/src/lib/components/InlineSubmitButton/InlineSubmitButton.js +2 -2
  7. package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +0 -1
  8. package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +1 -2
  9. package/src/lib/context/PasskeyContext/PasskeyContext.cjs +18 -7
  10. package/src/lib/context/PasskeyContext/PasskeyContext.js +18 -7
  11. package/src/lib/data/api/email/email.cjs +4 -4
  12. package/src/lib/data/api/email/email.js +4 -4
  13. package/src/lib/styles/index.shadow.cjs +1 -1
  14. package/src/lib/styles/index.shadow.js +1 -1
  15. package/src/lib/utils/constants/localStorage.cjs +0 -2
  16. package/src/lib/utils/constants/localStorage.d.ts +0 -1
  17. package/src/lib/utils/constants/localStorage.js +1 -2
  18. package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.cjs +2 -2
  19. package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.d.ts +1 -1
  20. package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.js +1 -1
  21. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +2 -3
  22. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +1 -2
  23. package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.cjs +2 -3
  24. package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.js +1 -2
  25. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -2
  26. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -2
  27. package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.cjs +1 -0
  28. package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.js +1 -0
  29. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +5 -4
  30. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +5 -4
  31. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +17 -16
  32. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +18 -17
  33. package/src/lib/utils/functions/getWalletProvider/getWalletProvider.cjs +0 -21
  34. package/src/lib/utils/functions/getWalletProvider/getWalletProvider.d.ts +0 -3
  35. package/src/lib/utils/functions/getWalletProvider/getWalletProvider.js +0 -17
  36. package/src/lib/utils/functions/getWalletProvider/index.d.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -1,4 +1,31 @@
1
1
 
2
+ ## [4.18.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.17.0...v4.18.0) (2025-05-07)
3
+
4
+
5
+ ### Features
6
+
7
+ * 7702 authorization now happens on the first transaction and could use sponsored user operation if paymaster provided (IMPORTANT: viem need to be upgraded to at least 2.28.4)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * inline email submit button color when active ([#8663](https://github.com/dynamic-labs/dynamic-auth/issues/8663)) ([ea556e9](https://github.com/dynamic-labs/dynamic-auth/commit/ea556e9116e876fb2180870e74b6c8c6a13faecb))
13
+
14
+ ## [4.17.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.16.0...v4.17.0) (2025-05-06)
15
+
16
+
17
+ ### Features
18
+
19
+ * add chain id option to create kernel client in react-native ([#8650](https://github.com/dynamic-labs/dynamic-auth/issues/8650)) ([1450bea](https://github.com/dynamic-labs/dynamic-auth/commit/1450bea6f979a82ed4880700aff14fa1ead9dc60))
20
+ * add sendCalls method to EthereumWallet ([#8634](https://github.com/dynamic-labs/dynamic-auth/issues/8634)) ([7c9aef9](https://github.com/dynamic-labs/dynamic-auth/commit/7c9aef95382b4823a40279bebfb084de32c25610))
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * 7702 do not override existing old aa ([#8630](https://github.com/dynamic-labs/dynamic-auth/issues/8630)) ([a731d9e](https://github.com/dynamic-labs/dynamic-auth/commit/a731d9e77ecd9e1dec3a7704a63989b5f2741a57))
26
+ * improve error message when email login fails ([#8649](https://github.com/dynamic-labs/dynamic-auth/issues/8649)) ([e1c03ac](https://github.com/dynamic-labs/dynamic-auth/commit/e1c03ac6dc83386c63d63db59d31355bc4fe2959))
27
+ * improve react-native stability on android ([#8652](https://github.com/dynamic-labs/dynamic-auth/issues/8652)) ([1617546](https://github.com/dynamic-labs/dynamic-auth/commit/1617546e6053c2ab32f7d385336c47df185d077f))
28
+
2
29
  ## [4.16.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.15.0...v4.16.0) (2025-05-03)
3
30
 
4
31
 
package/package.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.16.0";
6
+ var version = "4.18.0";
7
7
  var dependencies = {
8
8
  "@dynamic-labs/sdk-api-core": "0.0.660",
9
9
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client'
2
- var version = "4.16.0";
2
+ var version = "4.18.0";
3
3
  var dependencies = {
4
4
  "@dynamic-labs/sdk-api-core": "0.0.660",
5
5
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "4.16.0",
3
+ "version": "4.18.0",
4
4
  "dependencies": {
5
5
  "@dynamic-labs/sdk-api-core": "0.0.660",
6
6
  "@hcaptcha/react-hcaptcha": "1.4.4",
@@ -14,24 +14,24 @@
14
14
  "yup": "0.32.11",
15
15
  "react-international-phone": "4.2.5",
16
16
  "bs58": "5.0.0",
17
- "@dynamic-labs/assert-package-version": "4.16.0",
18
- "@dynamic-labs/iconic": "4.16.0",
19
- "@dynamic-labs/logger": "4.16.0",
20
- "@dynamic-labs/multi-wallet": "4.16.0",
21
- "@dynamic-labs/rpc-providers": "4.16.0",
22
- "@dynamic-labs/store": "4.16.0",
23
- "@dynamic-labs/types": "4.16.0",
24
- "@dynamic-labs/utils": "4.16.0",
25
- "@dynamic-labs/wallet-book": "4.16.0",
26
- "@dynamic-labs/wallet-connector-core": "4.16.0",
17
+ "@dynamic-labs/assert-package-version": "4.18.0",
18
+ "@dynamic-labs/iconic": "4.18.0",
19
+ "@dynamic-labs/logger": "4.18.0",
20
+ "@dynamic-labs/multi-wallet": "4.18.0",
21
+ "@dynamic-labs/rpc-providers": "4.18.0",
22
+ "@dynamic-labs/store": "4.18.0",
23
+ "@dynamic-labs/types": "4.18.0",
24
+ "@dynamic-labs/utils": "4.18.0",
25
+ "@dynamic-labs/wallet-book": "4.18.0",
26
+ "@dynamic-labs/wallet-connector-core": "4.18.0",
27
27
  "eventemitter3": "5.0.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "semver": "7.5.4"
31
31
  },
32
32
  "peerDependencies": {
33
- "react": "^18.0.0",
34
- "react-dom": "^18.0.0"
33
+ "react": ">=18.0.0 <20.0.0",
34
+ "react-dom": ">=18.0.0 <20.0.0"
35
35
  },
36
36
  "description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
37
37
  "author": "Dynamic Labs, Inc.",
@@ -15,8 +15,8 @@ const InlineSubmitButton = ({ disabled, highlighted, isFocused, isHovered, class
15
15
  if (!emailSubmitButtonInsideInput)
16
16
  return null;
17
17
  return (jsxRuntime.jsx(IconButton.IconButton, { "data-testid": 'in_line_submit_button', type: 'submit', className: classNames.classNames('inline-submit-button', className, {
18
- 'inline-submit-button--active': isFocused || isHovered,
19
- 'inline-submit-button--ready': highlighted,
18
+ 'icon-button--active': isFocused || isHovered,
19
+ 'icon-button--has-content': highlighted,
20
20
  }), disabled: disabled, style: style, children: jsxRuntime.jsx(arrowRightBackground.ReactComponent, {}) }));
21
21
  };
22
22
 
@@ -11,8 +11,8 @@ const InlineSubmitButton = ({ disabled, highlighted, isFocused, isHovered, class
11
11
  if (!emailSubmitButtonInsideInput)
12
12
  return null;
13
13
  return (jsx(IconButton, { "data-testid": 'in_line_submit_button', type: 'submit', className: classNames('inline-submit-button', className, {
14
- 'inline-submit-button--active': isFocused || isHovered,
15
- 'inline-submit-button--ready': highlighted,
14
+ 'icon-button--active': isFocused || isHovered,
15
+ 'icon-button--has-content': highlighted,
16
16
  }), disabled: disabled, style: style, children: jsx(SvgArrowRightBackground, {}) }));
17
17
  };
18
18
 
@@ -131,7 +131,6 @@ const useHandleLogout = (params) => {
131
131
  utils.StorageService.removeItem(localStorage.WALLET_PICKER_SEARCH_KEY);
132
132
  utils.StorageService.removeItem(localStorage.PHANTOM_SIGNATURE_STATE);
133
133
  utils.StorageService.removeItem(localStorage.AUTH_EXPIRES_AT);
134
- utils.StorageService.removeItem(localStorage.ZERODEV_AUTHORIZATION);
135
134
  p.setAuthMode(p.initialAuthenticationMode);
136
135
  p.setShowAuthFlow(false, {
137
136
  emitCancelAuth: false,
@@ -8,7 +8,7 @@ import '../../../../store/state/projectSettings/projectSettings.js';
8
8
  import { DYNAMIC_AUTH_COOKIE_NAME } from '../../../../utils/constants/values.js';
9
9
  import '@dynamic-labs/multi-wallet';
10
10
  import { logger } from '../../../../shared/logger.js';
11
- import { AUTH_TOKEN, AUTH_MIN_TOKEN, WALLET_PICKER_SEARCH_KEY, PHANTOM_SIGNATURE_STATE, AUTH_EXPIRES_AT, ZERODEV_AUTHORIZATION } from '../../../../utils/constants/localStorage.js';
11
+ import { AUTH_TOKEN, AUTH_MIN_TOKEN, WALLET_PICKER_SEARCH_KEY, PHANTOM_SIGNATURE_STATE, AUTH_EXPIRES_AT } from '../../../../utils/constants/localStorage.js';
12
12
  import '../../../../utils/constants/colors.js';
13
13
  import 'react-international-phone';
14
14
  import '@dynamic-labs/iconic';
@@ -127,7 +127,6 @@ const useHandleLogout = (params) => {
127
127
  StorageService.removeItem(WALLET_PICKER_SEARCH_KEY);
128
128
  StorageService.removeItem(PHANTOM_SIGNATURE_STATE);
129
129
  StorageService.removeItem(AUTH_EXPIRES_AT);
130
- StorageService.removeItem(ZERODEV_AUTHORIZATION);
131
130
  p.setAuthMode(p.initialAuthenticationMode);
132
131
  p.setShowAuthFlow(false, {
133
132
  emitCancelAuth: false,
@@ -52,7 +52,7 @@ require('../SocialRedirectContext/SocialRedirectContext.cjs');
52
52
  require('../LoadingContext/LoadingContext.cjs');
53
53
  var useEmbeddedWallet = require('../../utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs');
54
54
  require('../WalletContext/WalletContext.cjs');
55
- require('../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
55
+ var constants = require('../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
56
56
  require('yup');
57
57
  require('../MockContext/MockContext.cjs');
58
58
  require('../../views/CollectUserDataView/useFields.cjs');
@@ -103,7 +103,7 @@ require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
103
103
  const PasskeyContext = React.createContext(undefined);
104
104
  const PasskeyContextProviderWithBrowser = ({ children, }) => {
105
105
  var _a, _b, _c, _d, _e, _f, _g, _h;
106
- const { userHasEmbeddedWallet } = useEmbeddedWallet.useEmbeddedWallet();
106
+ const { userHasEmbeddedWallet, getWalletVersion } = useEmbeddedWallet.useEmbeddedWallet();
107
107
  const { isSessionKeyCompatible, isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet.useIsTurnkeyWallet();
108
108
  const { environmentId, projectSettings, user } = useInternalDynamicContext.useInternalDynamicContext();
109
109
  // state for when passkey list needs to re-render
@@ -138,12 +138,23 @@ const PasskeyContextProviderWithBrowser = ({ children, }) => {
138
138
  ]);
139
139
  // It fetches user passkeys if user has embedded wallet
140
140
  const getUserPasskeysResult = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
141
- const data = yield embeddedWallets.getUserPasskeys({
142
- environmentId: environmentId,
143
- });
144
- return data.passkeys;
141
+ const walletVersion = getWalletVersion();
142
+ const isV1Wallet = walletVersion === constants.EmbeddedWalletVersion.V1;
143
+ if (isV1Wallet) {
144
+ const data = yield embeddedWallets.getUserPasskeys({
145
+ environmentId: environmentId,
146
+ });
147
+ return data.passkeys;
148
+ }
149
+ return;
145
150
  }), {
146
- deps: [environmentId, user, userHasEmbeddedWallet(), passkeyEdited],
151
+ deps: [
152
+ environmentId,
153
+ user,
154
+ userHasEmbeddedWallet(),
155
+ passkeyEdited,
156
+ getWalletVersion,
157
+ ],
147
158
  enabled: Boolean(environmentId && user && userHasEmbeddedWallet()),
148
159
  });
149
160
  // Returns true if user has passkeys for current origin
@@ -48,7 +48,7 @@ import '../SocialRedirectContext/SocialRedirectContext.js';
48
48
  import '../LoadingContext/LoadingContext.js';
49
49
  import { useEmbeddedWallet } from '../../utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js';
50
50
  import '../WalletContext/WalletContext.js';
51
- import '../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
51
+ import { EmbeddedWalletVersion } from '../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
52
52
  import 'yup';
53
53
  import '../MockContext/MockContext.js';
54
54
  import '../../views/CollectUserDataView/useFields.js';
@@ -99,7 +99,7 @@ import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
99
99
  const PasskeyContext = createContext(undefined);
100
100
  const PasskeyContextProviderWithBrowser = ({ children, }) => {
101
101
  var _a, _b, _c, _d, _e, _f, _g, _h;
102
- const { userHasEmbeddedWallet } = useEmbeddedWallet();
102
+ const { userHasEmbeddedWallet, getWalletVersion } = useEmbeddedWallet();
103
103
  const { isSessionKeyCompatible, isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet();
104
104
  const { environmentId, projectSettings, user } = useInternalDynamicContext();
105
105
  // state for when passkey list needs to re-render
@@ -134,12 +134,23 @@ const PasskeyContextProviderWithBrowser = ({ children, }) => {
134
134
  ]);
135
135
  // It fetches user passkeys if user has embedded wallet
136
136
  const getUserPasskeysResult = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
137
- const data = yield getUserPasskeys({
138
- environmentId: environmentId,
139
- });
140
- return data.passkeys;
137
+ const walletVersion = getWalletVersion();
138
+ const isV1Wallet = walletVersion === EmbeddedWalletVersion.V1;
139
+ if (isV1Wallet) {
140
+ const data = yield getUserPasskeys({
141
+ environmentId: environmentId,
142
+ });
143
+ return data.passkeys;
144
+ }
145
+ return;
141
146
  }), {
142
- deps: [environmentId, user, userHasEmbeddedWallet(), passkeyEdited],
147
+ deps: [
148
+ environmentId,
149
+ user,
150
+ userHasEmbeddedWallet(),
151
+ passkeyEdited,
152
+ getWalletVersion,
153
+ ],
143
154
  enabled: Boolean(environmentId && user && userHasEmbeddedWallet()),
144
155
  });
145
156
  // Returns true if user has passkeys for current origin
@@ -22,7 +22,7 @@ const createEmailVerification = (_a) => _tslib.__awaiter(void 0, [_a], void 0, f
22
22
  }
23
23
  catch (e) {
24
24
  const data = yield utils.logResponseError(e, 'Error creating email verification');
25
- throw new utils$1.EmailVerificationError(data.code);
25
+ throw new utils$1.EmailVerificationError(data.error, data.code);
26
26
  }
27
27
  });
28
28
  const signInWithEmailVerification = (_b) => _tslib.__awaiter(void 0, [_b], void 0, function* ({ verificationToken, verificationUUID, environmentId, captchaToken, sessionPublicKey, }) {
@@ -49,7 +49,7 @@ const signInWithEmailVerification = (_b) => _tslib.__awaiter(void 0, [_b], void
49
49
  if (data.error.code === 'sandbox_maximum_threshold_reached') {
50
50
  throw new utils$1.SandboxMaximumThresholdReachedError(data.error.message);
51
51
  }
52
- throw new utils$1.EmailVerificationError(data.code);
52
+ throw new utils$1.EmailVerificationError(data.error, data.code);
53
53
  }
54
54
  });
55
55
  const retryEmailVerification = (_c) => _tslib.__awaiter(void 0, [_c], void 0, function* ({ email, environmentId, verificationUUID, }) {
@@ -65,7 +65,7 @@ const retryEmailVerification = (_c) => _tslib.__awaiter(void 0, [_c], void 0, fu
65
65
  }
66
66
  catch (e) {
67
67
  const data = yield utils.logResponseError(e, 'Error retrying email verification');
68
- throw new utils$1.EmailVerificationError(data.code);
68
+ throw new utils$1.EmailVerificationError(data.error, data.code);
69
69
  }
70
70
  });
71
71
  const verifyEmail = (_d) => _tslib.__awaiter(void 0, [_d], void 0, function* ({ verificationToken, verificationUUID, environmentId, }) {
@@ -87,7 +87,7 @@ const verifyEmail = (_d) => _tslib.__awaiter(void 0, [_d], void 0, function* ({
87
87
  if (data.error.code === 'sandbox_maximum_threshold_reached') {
88
88
  throw new utils$1.SandboxMaximumThresholdReachedError(data.error.message);
89
89
  }
90
- throw new utils$1.EmailVerificationError(data.code);
90
+ throw new utils$1.EmailVerificationError(data.error, data.code);
91
91
  }
92
92
  });
93
93
 
@@ -18,7 +18,7 @@ const createEmailVerification = (_a) => __awaiter(void 0, [_a], void 0, function
18
18
  }
19
19
  catch (e) {
20
20
  const data = yield logResponseError(e, 'Error creating email verification');
21
- throw new EmailVerificationError(data.code);
21
+ throw new EmailVerificationError(data.error, data.code);
22
22
  }
23
23
  });
24
24
  const signInWithEmailVerification = (_b) => __awaiter(void 0, [_b], void 0, function* ({ verificationToken, verificationUUID, environmentId, captchaToken, sessionPublicKey, }) {
@@ -45,7 +45,7 @@ const signInWithEmailVerification = (_b) => __awaiter(void 0, [_b], void 0, func
45
45
  if (data.error.code === 'sandbox_maximum_threshold_reached') {
46
46
  throw new SandboxMaximumThresholdReachedError(data.error.message);
47
47
  }
48
- throw new EmailVerificationError(data.code);
48
+ throw new EmailVerificationError(data.error, data.code);
49
49
  }
50
50
  });
51
51
  const retryEmailVerification = (_c) => __awaiter(void 0, [_c], void 0, function* ({ email, environmentId, verificationUUID, }) {
@@ -61,7 +61,7 @@ const retryEmailVerification = (_c) => __awaiter(void 0, [_c], void 0, function*
61
61
  }
62
62
  catch (e) {
63
63
  const data = yield logResponseError(e, 'Error retrying email verification');
64
- throw new EmailVerificationError(data.code);
64
+ throw new EmailVerificationError(data.error, data.code);
65
65
  }
66
66
  });
67
67
  const verifyEmail = (_d) => __awaiter(void 0, [_d], void 0, function* ({ verificationToken, verificationUUID, environmentId, }) {
@@ -83,7 +83,7 @@ const verifyEmail = (_d) => __awaiter(void 0, [_d], void 0, function* ({ verific
83
83
  if (data.error.code === 'sandbox_maximum_threshold_reached') {
84
84
  throw new SandboxMaximumThresholdReachedError(data.error.message);
85
85
  }
86
- throw new EmailVerificationError(data.code);
86
+ throw new EmailVerificationError(data.error, data.code);
87
87
  }
88
88
  });
89
89