@dynamic-labs/sdk-react-core 4.18.0 → 4.18.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +12 -12
  5. package/src/lib/components/AppOriginTile/AppOriginTile.cjs +14 -14
  6. package/src/lib/components/AppOriginTile/AppOriginTile.d.ts +2 -2
  7. package/src/lib/components/AppOriginTile/AppOriginTile.js +16 -16
  8. package/src/lib/components/Chip/Chip.cjs +14 -0
  9. package/src/lib/components/Chip/Chip.js +10 -0
  10. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +1 -1
  11. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +1 -1
  12. package/src/lib/context/ViewContext/ViewContext.cjs +7 -2
  13. package/src/lib/context/ViewContext/ViewContext.js +7 -2
  14. package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +8 -3
  15. package/src/lib/data/api/embeddedWallets/embeddedWallets.d.ts +4 -2
  16. package/src/lib/data/api/embeddedWallets/embeddedWallets.js +8 -3
  17. package/src/lib/locale/en/translation.cjs +8 -4
  18. package/src/lib/locale/en/translation.d.ts +6 -2
  19. package/src/lib/locale/en/translation.js +8 -4
  20. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +8 -8
  21. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +9 -9
  22. package/src/lib/shared/utils/functions/getGlobalWalletContext/getGlobalWalletContext.cjs +15 -0
  23. package/src/lib/shared/utils/functions/getGlobalWalletContext/getGlobalWalletContext.d.ts +11 -0
  24. package/src/lib/shared/utils/functions/getGlobalWalletContext/getGlobalWalletContext.js +11 -0
  25. package/src/lib/shared/utils/functions/getGlobalWalletContext/index.d.ts +1 -0
  26. package/src/lib/shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs +2 -0
  27. package/src/lib/shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js +2 -0
  28. package/src/lib/styles/index.shadow.cjs +1 -1
  29. package/src/lib/styles/index.shadow.js +1 -1
  30. package/src/lib/utils/functions/getPrimaryTurnkeyWalletId/getPrimaryTurnkeyWalletId.cjs +33 -0
  31. package/src/lib/utils/functions/getPrimaryTurnkeyWalletId/getPrimaryTurnkeyWalletId.d.ts +7 -0
  32. package/src/lib/utils/functions/getPrimaryTurnkeyWalletId/getPrimaryTurnkeyWalletId.js +29 -0
  33. package/src/lib/utils/functions/getPrimaryTurnkeyWalletId/inedex.d.ts +1 -0
  34. package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.cjs +1 -1
  35. package/src/lib/utils/hooks/useDynamicWaas/useDynamicWaas.js +1 -1
  36. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +1 -1
  37. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +1 -1
  38. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.cjs +6 -1
  39. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.js +6 -1
  40. package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.cjs +8 -1
  41. package/src/lib/utils/hooks/useEmbeddedWalletSessionKeys/useEmbeddedWalletSessionKeys.js +8 -1
  42. package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.cjs +1 -1
  43. package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.js +1 -1
  44. package/src/lib/views/EmbeddedDeleteView/EmbeddedDeleteView.cjs +3 -0
  45. package/src/lib/views/EmbeddedDeleteView/EmbeddedDeleteView.js +3 -0
  46. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +7 -1
  47. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +7 -1
  48. package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +1 -1
  49. package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +1 -1
  50. package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +4 -4
  51. package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +4 -4
  52. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +1 -1
  53. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +1 -1
  54. package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.cjs +2 -1
  55. package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.js +2 -1
  56. package/src/lib/components/AppOriginTile/AppOriginTile.types.d.ts +0 -7
package/CHANGELOG.md CHANGED
@@ -1,4 +1,17 @@
1
1
 
2
+ ### [4.18.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.18.0...v4.18.1) (2025-05-09)
3
+
4
+
5
+ ### Features
6
+
7
+ * allow setting zerodev bundler provider from dashboard ([#8548](https://github.com/dynamic-labs/dynamic-auth/issues/8548)) ([d226733](https://github.com/dynamic-labs/dynamic-auth/commit/d2267334db3d9d742833437c81a382742c8d6a74))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * correctly show back button on connect with qr view ([#8668](https://github.com/dynamic-labs/dynamic-auth/issues/8668)) ([3cff309](https://github.com/dynamic-labs/dynamic-auth/commit/3cff309fa35d7201d0c098b793334908716bc0db))
13
+ * display correct app origin when signing message with global wallet ([#8677](https://github.com/dynamic-labs/dynamic-auth/issues/8677)) ([a70eeb3](https://github.com/dynamic-labs/dynamic-auth/commit/a70eeb3ea28a5ad749cb5c14a0d3c49318099712))
14
+
2
15
  ## [4.18.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.17.0...v4.18.0) (2025-05-07)
3
16
 
4
17
 
package/package.cjs CHANGED
@@ -3,9 +3,9 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.18.0";
6
+ var version = "4.18.1";
7
7
  var dependencies = {
8
- "@dynamic-labs/sdk-api-core": "0.0.660",
8
+ "@dynamic-labs/sdk-api-core": "0.0.663",
9
9
  "@hcaptcha/react-hcaptcha": "1.4.4",
10
10
  "@thumbmarkjs/thumbmarkjs": "0.16.0",
11
11
  "country-list": "2.3.0",
package/package.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client'
2
- var version = "4.18.0";
2
+ var version = "4.18.1";
3
3
  var dependencies = {
4
- "@dynamic-labs/sdk-api-core": "0.0.660",
4
+ "@dynamic-labs/sdk-api-core": "0.0.663",
5
5
  "@hcaptcha/react-hcaptcha": "1.4.4",
6
6
  "@thumbmarkjs/thumbmarkjs": "0.16.0",
7
7
  "country-list": "2.3.0",
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "4.18.0",
3
+ "version": "4.18.1",
4
4
  "dependencies": {
5
- "@dynamic-labs/sdk-api-core": "0.0.660",
5
+ "@dynamic-labs/sdk-api-core": "0.0.663",
6
6
  "@hcaptcha/react-hcaptcha": "1.4.4",
7
7
  "@thumbmarkjs/thumbmarkjs": "0.16.0",
8
8
  "country-list": "2.3.0",
@@ -14,16 +14,16 @@
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.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",
17
+ "@dynamic-labs/assert-package-version": "4.18.1",
18
+ "@dynamic-labs/iconic": "4.18.1",
19
+ "@dynamic-labs/logger": "4.18.1",
20
+ "@dynamic-labs/multi-wallet": "4.18.1",
21
+ "@dynamic-labs/rpc-providers": "4.18.1",
22
+ "@dynamic-labs/store": "4.18.1",
23
+ "@dynamic-labs/types": "4.18.1",
24
+ "@dynamic-labs/utils": "4.18.1",
25
+ "@dynamic-labs/wallet-book": "4.18.1",
26
+ "@dynamic-labs/wallet-connector-core": "4.18.1",
27
27
  "eventemitter3": "5.0.1"
28
28
  },
29
29
  "devDependencies": {
@@ -5,23 +5,23 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var React = require('react');
8
+ var utils = require('@dynamic-labs/utils');
8
9
  var Typography = require('../Typography/Typography.cjs');
10
+ var Chip = require('../Chip/Chip.cjs');
11
+ var getGlobalWalletContext = require('../../shared/utils/functions/getGlobalWalletContext/getGlobalWalletContext.cjs');
9
12
 
10
- const AppOriginTile = ({ appLogoUrl, appName, appOrigin, }) => {
11
- const ref = React.useRef(null);
12
- const [showAppName, setShowAppName] = React.useState(false);
13
- React.useLayoutEffect(() => {
14
- if (ref.current) {
15
- const { width, height } = ref.current.getBoundingClientRect();
16
- if (width < height * 2) {
17
- setShowAppName(true);
18
- }
19
- else {
20
- setShowAppName(false);
21
- }
13
+ const AppOriginTile = () => {
14
+ const { requesterOrigin } = getGlobalWalletContext.getGlobalWalletContext();
15
+ const origin = React.useMemo(() => {
16
+ if (requesterOrigin) {
17
+ return requesterOrigin;
22
18
  }
23
- }, [ref, setShowAppName]);
24
- return (jsxRuntime.jsxs("div", { className: 'app-origin-tile', children: [Boolean(appName) && (jsxRuntime.jsx("div", { className: 'app-origin-tile__title', children: appLogoUrl ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("img", { alt: 'app_logo', src: appLogoUrl, className: 'app-origin-tile__logo', ref: ref }), showAppName && (jsxRuntime.jsx(Typography.Typography, { color: 'primary', variant: 'body_normal', children: appName }))] })) : (jsxRuntime.jsx(Typography.Typography, { "data-testid": 'app-name', color: 'primary', variant: 'body_normal', children: appName })) })), appOrigin && (jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_normal', weight: 'regular', children: appOrigin }))] }));
19
+ return utils.PlatformService.getDisplayOrigin();
20
+ }, [requesterOrigin]);
21
+ if (!origin) {
22
+ return null;
23
+ }
24
+ return (jsxRuntime.jsx(Chip.Chip, { className: 'app-origin-tile', children: jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_normal', weight: 'regular', children: origin }) }));
25
25
  };
26
26
 
27
27
  exports.AppOriginTile = AppOriginTile;
@@ -1,2 +1,2 @@
1
- import { AppOriginTileComponent } from './AppOriginTile.types';
2
- export declare const AppOriginTile: AppOriginTileComponent;
1
+ import { FC } from 'react';
2
+ export declare const AppOriginTile: FC;
@@ -1,23 +1,23 @@
1
1
  'use client'
2
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
- import { useRef, useState, useLayoutEffect } from 'react';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { useMemo } from 'react';
4
+ import { PlatformService } from '@dynamic-labs/utils';
4
5
  import { Typography } from '../Typography/Typography.js';
6
+ import { Chip } from '../Chip/Chip.js';
7
+ import { getGlobalWalletContext } from '../../shared/utils/functions/getGlobalWalletContext/getGlobalWalletContext.js';
5
8
 
6
- const AppOriginTile = ({ appLogoUrl, appName, appOrigin, }) => {
7
- const ref = useRef(null);
8
- const [showAppName, setShowAppName] = useState(false);
9
- useLayoutEffect(() => {
10
- if (ref.current) {
11
- const { width, height } = ref.current.getBoundingClientRect();
12
- if (width < height * 2) {
13
- setShowAppName(true);
14
- }
15
- else {
16
- setShowAppName(false);
17
- }
9
+ const AppOriginTile = () => {
10
+ const { requesterOrigin } = getGlobalWalletContext();
11
+ const origin = useMemo(() => {
12
+ if (requesterOrigin) {
13
+ return requesterOrigin;
18
14
  }
19
- }, [ref, setShowAppName]);
20
- return (jsxs("div", { className: 'app-origin-tile', children: [Boolean(appName) && (jsx("div", { className: 'app-origin-tile__title', children: appLogoUrl ? (jsxs(Fragment, { children: [jsx("img", { alt: 'app_logo', src: appLogoUrl, className: 'app-origin-tile__logo', ref: ref }), showAppName && (jsx(Typography, { color: 'primary', variant: 'body_normal', children: appName }))] })) : (jsx(Typography, { "data-testid": 'app-name', color: 'primary', variant: 'body_normal', children: appName })) })), appOrigin && (jsx(Typography, { color: 'secondary', variant: 'body_normal', weight: 'regular', children: appOrigin }))] }));
15
+ return PlatformService.getDisplayOrigin();
16
+ }, [requesterOrigin]);
17
+ if (!origin) {
18
+ return null;
19
+ }
20
+ return (jsx(Chip, { className: 'app-origin-tile', children: jsx(Typography, { color: 'secondary', variant: 'body_normal', weight: 'regular', children: origin }) }));
21
21
  };
22
22
 
23
23
  export { AppOriginTile };
@@ -0,0 +1,14 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+ var Typography = require('../Typography/Typography.cjs');
8
+ var classNames = require('../../utils/functions/classNames/classNames.cjs');
9
+
10
+ const Chip = ({ children, icon, className, }) => (jsxRuntime.jsxs("div", { className: classNames.classNames('chip', className, {
11
+ 'chip__with-icon': Boolean(icon),
12
+ }), children: [Boolean(icon) && jsxRuntime.jsx("div", { className: 'chip--icon', children: icon }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', children: children })] }));
13
+
14
+ exports.Chip = Chip;
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { Typography } from '../Typography/Typography.js';
4
+ import { classNames } from '../../utils/functions/classNames/classNames.js';
5
+
6
+ const Chip = ({ children, icon, className, }) => (jsxs("div", { className: classNames('chip', className, {
7
+ 'chip__with-icon': Boolean(icon),
8
+ }), children: [Boolean(icon) && jsx("div", { className: 'chip--icon', children: icon }), jsx(Typography, { variant: 'body_small', children: children })] }));
9
+
10
+ export { Chip };
@@ -37,11 +37,11 @@ require('../../locale/locale.cjs');
37
37
  require('react-dom');
38
38
  require('../../utils/functions/compareChains/compareChains.cjs');
39
39
  require('../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
40
+ require('../../store/state/primaryWalletId/primaryWalletId.cjs');
40
41
  require('../ThemeContext/ThemeContext.cjs');
41
42
  require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
42
43
  require('bs58');
43
44
  require('@dynamic-labs/types');
44
- require('../../store/state/primaryWalletId/primaryWalletId.cjs');
45
45
  require('../AccountExistsContext/AccountExistsContext.cjs');
46
46
  require('../LoadingContext/LoadingContext.cjs');
47
47
  require('../WalletContext/WalletContext.cjs');
@@ -33,11 +33,11 @@ import '../../locale/locale.js';
33
33
  import 'react-dom';
34
34
  import '../../utils/functions/compareChains/compareChains.js';
35
35
  import '../../views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
36
+ import '../../store/state/primaryWalletId/primaryWalletId.js';
36
37
  import '../ThemeContext/ThemeContext.js';
37
38
  import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
38
39
  import 'bs58';
39
40
  import '@dynamic-labs/types';
40
- import '../../store/state/primaryWalletId/primaryWalletId.js';
41
41
  import '../AccountExistsContext/AccountExistsContext.js';
42
42
  import '../LoadingContext/LoadingContext.js';
43
43
  import '../WalletContext/WalletContext.js';
@@ -32,8 +32,13 @@ const ViewContextProvider = ({ children, initialViewType }) => {
32
32
  if (view.type === type)
33
33
  return;
34
34
  clearError();
35
- setStack((prev) => [...prev.slice(0, -1), { events, props, type }]);
36
- }, [clearError, view]);
35
+ setStack((prev) => {
36
+ if (prev.length <= 1) {
37
+ return [{ type: initialViewType }, { events, props, type }];
38
+ }
39
+ return [...prev.slice(0, -1), { events, props, type }];
40
+ });
41
+ }, [clearError, initialViewType, view.type]);
37
42
  const canGoBack = stack.length > 1;
38
43
  const goBack = React.useCallback(() => {
39
44
  if (!canGoBack)
@@ -28,8 +28,13 @@ const ViewContextProvider = ({ children, initialViewType }) => {
28
28
  if (view.type === type)
29
29
  return;
30
30
  clearError();
31
- setStack((prev) => [...prev.slice(0, -1), { events, props, type }]);
32
- }, [clearError, view]);
31
+ setStack((prev) => {
32
+ if (prev.length <= 1) {
33
+ return [{ type: initialViewType }, { events, props, type }];
34
+ }
35
+ return [...prev.slice(0, -1), { events, props, type }];
36
+ });
37
+ }, [clearError, initialViewType, view.type]);
33
38
  const canGoBack = stack.length > 1;
34
39
  const goBack = useCallback(() => {
35
40
  if (!canGoBack)
@@ -143,12 +143,16 @@ const exportEmbeddedWallet = (_g) => _tslib.__awaiter(void 0, [_g], void 0, func
143
143
  return { exportBundle: '' };
144
144
  }
145
145
  });
146
- const registerSessionKey = (_h) => _tslib.__awaiter(void 0, [_h], void 0, function* ({ environmentId, publicKey, prevSessionKeySignature, }) {
146
+ const registerSessionKey = (_h) => _tslib.__awaiter(void 0, [_h], void 0, function* ({ environmentId, walletId, publicKey, prevSessionKeySignature, }) {
147
147
  let response;
148
148
  try {
149
149
  response = yield api.sdkApi().registerSessionKey({
150
150
  environmentId,
151
- registerSessionKeyRequest: { prevSessionKeySignature, publicKey },
151
+ registerSessionKeyRequest: {
152
+ prevSessionKeySignature,
153
+ publicKey,
154
+ walletId,
155
+ },
152
156
  });
153
157
  }
154
158
  catch (error) {
@@ -203,10 +207,11 @@ const createEmbeddedWalletAccount = (_k) => _tslib.__awaiter(void 0, [_k], void
203
207
  throw new utils.DynamicError('Error creating embedded wallet account');
204
208
  }
205
209
  });
206
- const getDeleteEmbeddedWalletsRequest = (_l) => _tslib.__awaiter(void 0, [_l], void 0, function* ({ environmentId, }) {
210
+ const getDeleteEmbeddedWalletsRequest = (_l) => _tslib.__awaiter(void 0, [_l], void 0, function* ({ environmentId, walletId, }) {
207
211
  try {
208
212
  const response = yield api.sdkApi().getEmbeddedWalletsDeleteRequest({
209
213
  environmentId,
214
+ walletId,
210
215
  });
211
216
  return response;
212
217
  }
@@ -12,8 +12,9 @@ export declare const exportEmbeddedWallet: ({ environmentId, walletId, activityI
12
12
  walletId: string;
13
13
  activityId: string;
14
14
  }) => Promise<ExportEmbeddedWalletResponse>;
15
- export declare const registerSessionKey: ({ environmentId, publicKey, prevSessionKeySignature, }: {
15
+ export declare const registerSessionKey: ({ environmentId, walletId, publicKey, prevSessionKeySignature, }: {
16
16
  environmentId: string;
17
+ walletId: string;
17
18
  publicKey: string;
18
19
  prevSessionKeySignature?: string;
19
20
  }) => Promise<RegisterEmbeddedWalletSessionKeyResponse>;
@@ -32,8 +33,9 @@ export declare const createEmbeddedWalletAccount: ({ environmentId, createEmbedd
32
33
  };
33
34
  };
34
35
  }) => Promise<import("@dynamic-labs/sdk-api-core").VerifyResponse>;
35
- export declare const getDeleteEmbeddedWalletsRequest: ({ environmentId, }: {
36
+ export declare const getDeleteEmbeddedWalletsRequest: ({ environmentId, walletId, }: {
36
37
  environmentId: string;
38
+ walletId: string;
37
39
  }) => Promise<import("@dynamic-labs/sdk-api-core").TurnkeyDeleteEmbeddedWalletsRequestBody>;
38
40
  export declare const deleteEmbeddedWallets: ({ environmentId, deleteEmbeddedWalletsRequest, }: {
39
41
  environmentId: string;
@@ -139,12 +139,16 @@ const exportEmbeddedWallet = (_g) => __awaiter(void 0, [_g], void 0, function* (
139
139
  return { exportBundle: '' };
140
140
  }
141
141
  });
142
- const registerSessionKey = (_h) => __awaiter(void 0, [_h], void 0, function* ({ environmentId, publicKey, prevSessionKeySignature, }) {
142
+ const registerSessionKey = (_h) => __awaiter(void 0, [_h], void 0, function* ({ environmentId, walletId, publicKey, prevSessionKeySignature, }) {
143
143
  let response;
144
144
  try {
145
145
  response = yield sdkApi().registerSessionKey({
146
146
  environmentId,
147
- registerSessionKeyRequest: { prevSessionKeySignature, publicKey },
147
+ registerSessionKeyRequest: {
148
+ prevSessionKeySignature,
149
+ publicKey,
150
+ walletId,
151
+ },
148
152
  });
149
153
  }
150
154
  catch (error) {
@@ -199,10 +203,11 @@ const createEmbeddedWalletAccount = (_k) => __awaiter(void 0, [_k], void 0, func
199
203
  throw new DynamicError('Error creating embedded wallet account');
200
204
  }
201
205
  });
202
- const getDeleteEmbeddedWalletsRequest = (_l) => __awaiter(void 0, [_l], void 0, function* ({ environmentId, }) {
206
+ const getDeleteEmbeddedWalletsRequest = (_l) => __awaiter(void 0, [_l], void 0, function* ({ environmentId, walletId, }) {
203
207
  try {
204
208
  const response = yield sdkApi().getEmbeddedWalletsDeleteRequest({
205
209
  environmentId,
210
+ walletId,
206
211
  });
207
212
  return response;
208
213
  }
@@ -1988,15 +1988,19 @@ const translation = {
1988
1988
  * @description copy keys for sign message flow views
1989
1989
  * @default
1990
1990
  * {
1991
- cancel_button: 'Cancel',
1991
+ cancel_button: 'Reject',
1992
1992
  sign_button: 'Sign',
1993
- title: 'Requesting Signature',
1993
+ title: 'Signature request',
1994
+ warning: 'Only sign this message if you trust this site.',
1995
+ message_label: 'Message:',
1994
1996
  }
1995
1997
  */
1996
1998
  dyn_sign_message: {
1997
- cancel_button: 'Cancel',
1999
+ cancel_button: 'Reject',
1998
2000
  sign_button: 'Sign',
1999
- title: 'Requesting Signature',
2001
+ title: 'Signature request',
2002
+ warning: 'Only sign this message if you trust this site.',
2003
+ message_label: 'Message:',
2000
2004
  },
2001
2005
  /**
2002
2006
  * @description copy keys for social redirect view
@@ -1984,15 +1984,19 @@ export declare const translation: {
1984
1984
  * @description copy keys for sign message flow views
1985
1985
  * @default
1986
1986
  * {
1987
- cancel_button: 'Cancel',
1987
+ cancel_button: 'Reject',
1988
1988
  sign_button: 'Sign',
1989
- title: 'Requesting Signature',
1989
+ title: 'Signature request',
1990
+ warning: 'Only sign this message if you trust this site.',
1991
+ message_label: 'Message:',
1990
1992
  }
1991
1993
  */
1992
1994
  dyn_sign_message: {
1993
1995
  cancel_button: string;
1994
1996
  sign_button: string;
1995
1997
  title: string;
1998
+ warning: string;
1999
+ message_label: string;
1996
2000
  };
1997
2001
  /**
1998
2002
  * @description copy keys for social redirect view
@@ -1984,15 +1984,19 @@ const translation = {
1984
1984
  * @description copy keys for sign message flow views
1985
1985
  * @default
1986
1986
  * {
1987
- cancel_button: 'Cancel',
1987
+ cancel_button: 'Reject',
1988
1988
  sign_button: 'Sign',
1989
- title: 'Requesting Signature',
1989
+ title: 'Signature request',
1990
+ warning: 'Only sign this message if you trust this site.',
1991
+ message_label: 'Message:',
1990
1992
  }
1991
1993
  */
1992
1994
  dyn_sign_message: {
1993
- cancel_button: 'Cancel',
1995
+ cancel_button: 'Reject',
1994
1996
  sign_button: 'Sign',
1995
- title: 'Requesting Signature',
1997
+ title: 'Signature request',
1998
+ warning: 'Only sign this message if you trust this site.',
1999
+ message_label: 'Message:',
1996
2000
  },
1997
2001
  /**
1998
2002
  * @description copy keys for social redirect view
@@ -124,7 +124,7 @@ const SignMessageConfirmationModal = ({ message, handler, onReject, onSignMessag
124
124
  const [show, setShow] = React.useState(true);
125
125
  const { initPasskeyRecoveryProcess, shouldInitRecovery } = usePasskeyRecovery.usePasskeyRecovery();
126
126
  const { isTurnkeyWallet } = useIsTurnkeyWallet.useIsTurnkeyWallet();
127
- const { setShowAuthFlow, primaryWallet, user, appLogoUrl, appName } = useInternalDynamicContext.useInternalDynamicContext();
127
+ const { setShowAuthFlow, primaryWallet, user } = useInternalDynamicContext.useInternalDynamicContext();
128
128
  const { pushView } = ViewContext.useViewContext();
129
129
  const { userNeedsCrossDomainPasskey } = PasskeyContext.usePasskeyContext();
130
130
  const { t } = reactI18next.useTranslation();
@@ -200,14 +200,14 @@ const SignMessageConfirmationModal = ({ message, handler, onReject, onSignMessag
200
200
  const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading, children: jsxRuntime.jsx(close.ReactComponent, {}) }));
201
201
  return hideModal ? null : (jsxRuntime.jsx(Portal.Portal, { handleClose: handleOnReject, isShown: show, zIndex: index.authModalZIndex, withBackdrop: true, elementId: 'dynamic-sign-message', transitionEvents: {
202
202
  onUnmount: handleOnModalUnmount,
203
- }, children: jsxRuntime.jsx(Modal.Modal, { children: jsxRuntime.jsxs(ModalCard.ModalCard, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: (props) => (jsxRuntime.jsx(Icon.Icon, { color: 'brand-primary', children: jsxRuntime.jsx(signCircle.ReactComponent, Object.assign({}, props)) })), iconSize: 64, isSpinning: true }) }), jsxRuntime.jsx(PasskeyCreatedSuccessBanner.PasskeyCreatedSuccessBanner, {}), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__body', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'sign-message-confirmation__title', copykey: 'dyn_sign_message.title', children: t('dyn_sign_message.title') }), jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: signMessageError && (jsxRuntime.jsx("div", { className: 'sign-message-confirmation__error', children: jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: errorText }) })) }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__message-container', children: [jsxRuntime.jsx(AppOriginTile.AppOriginTile, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: utils.PlatformService.getDisplayOrigin() }), jsxRuntime.jsx("div", { className: 'sign-message-confirmation__message', children: jsxRuntime.jsx(SignMessagePreview.SignMessagePreview
204
- // strip if entire message is a quote and replace escaped newlines
205
- , {
203
+ }, children: jsxRuntime.jsx(Modal.Modal, { children: jsxRuntime.jsxs(ModalCard.ModalCard, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: (props) => (jsxRuntime.jsx(Icon.Icon, { color: 'brand-primary', children: jsxRuntime.jsx(signCircle.ReactComponent, Object.assign({}, props)) })), iconSize: 64, isSpinning: true }) }), jsxRuntime.jsx(PasskeyCreatedSuccessBanner.PasskeyCreatedSuccessBanner, {}), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__body', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'sign-message-confirmation__title', copykey: 'dyn_sign_message.title', children: t('dyn_sign_message.title') }), jsxRuntime.jsx(AppOriginTile.AppOriginTile, {}), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', className: 'sign-message-confirmation__warning', copykey: 'dyn_sign_message.warning', children: t('dyn_sign_message.warning') }), jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: signMessageError && (jsxRuntime.jsx("div", { className: 'sign-message-confirmation__error', children: jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: errorText }) })) }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__message-container-wrapper', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'bold', className: 'sign-message-confirmation__message-container-label', copykey: 'dyn_sign_message.message_label', children: t('dyn_sign_message.message_label') }), jsxRuntime.jsx("div", { className: 'sign-message-confirmation__message-container', children: jsxRuntime.jsx("div", { className: 'sign-message-confirmation__message', children: jsxRuntime.jsx(SignMessagePreview.SignMessagePreview
206
204
  // strip if entire message is a quote and replace escaped newlines
207
- message: message
208
- .toString()
209
- .replace(/^"(.*)"$/, '$1')
210
- .replace(/\\n/g, '\n') }) })] }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, copykey: 'dyn_sign_message.cancel_button', children: t('dyn_sign_message.cancel_button') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'primary', buttonPadding: 'large', onClick: handleMessageSign, expanded: true, loading: isLoading, copykey: 'dyn_sign_message.sign_button', dataTestId: 'sign-button', children: t('dyn_sign_message.sign_button') })] }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, {}), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] })] }) }) }));
205
+ , {
206
+ // strip if entire message is a quote and replace escaped newlines
207
+ message: message
208
+ .toString()
209
+ .replace(/^"(.*)"$/, '$1')
210
+ .replace(/\\n/g, '\n') }) }) })] }), jsxRuntime.jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, copykey: 'dyn_sign_message.cancel_button', children: t('dyn_sign_message.cancel_button') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'primary', buttonPadding: 'large', onClick: handleMessageSign, expanded: true, loading: isLoading, copykey: 'dyn_sign_message.sign_button', dataTestId: 'sign-button', children: t('dyn_sign_message.sign_button') })] }), jsxRuntime.jsx(NeedHelpSection.NeedHelpSection, {}), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] })] }) }) }));
211
211
  };
212
212
 
213
213
  exports.SignMessageConfirmationModal = SignMessageConfirmationModal;
@@ -3,7 +3,7 @@ import { __awaiter } from '../../../../_virtual/_tslib.js';
3
3
  import { jsx, jsxs } from 'react/jsx-runtime';
4
4
  import { useRef, useState, useCallback, useMemo } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
- import { DynamicError, AccessBlockedError, UserRejectedRequestError, PlatformService } from '@dynamic-labs/utils';
6
+ import { DynamicError, AccessBlockedError, UserRejectedRequestError } from '@dynamic-labs/utils';
7
7
  import { isSessionKeyCompatibleWallet } from '@dynamic-labs/wallet-connector-core';
8
8
  import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
9
9
  import '../../components/Alert/Alert.js';
@@ -120,7 +120,7 @@ const SignMessageConfirmationModal = ({ message, handler, onReject, onSignMessag
120
120
  const [show, setShow] = useState(true);
121
121
  const { initPasskeyRecoveryProcess, shouldInitRecovery } = usePasskeyRecovery();
122
122
  const { isTurnkeyWallet } = useIsTurnkeyWallet();
123
- const { setShowAuthFlow, primaryWallet, user, appLogoUrl, appName } = useInternalDynamicContext();
123
+ const { setShowAuthFlow, primaryWallet, user } = useInternalDynamicContext();
124
124
  const { pushView } = useViewContext();
125
125
  const { userNeedsCrossDomainPasskey } = usePasskeyContext();
126
126
  const { t } = useTranslation();
@@ -196,14 +196,14 @@ const SignMessageConfirmationModal = ({ message, handler, onReject, onSignMessag
196
196
  const closeButton = (jsx(IconButton, { type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading, children: jsx(SvgClose, {}) }));
197
197
  return hideModal ? null : (jsx(Portal, { handleClose: handleOnReject, isShown: show, zIndex: authModalZIndex, withBackdrop: true, elementId: 'dynamic-sign-message', transitionEvents: {
198
198
  onUnmount: handleOnModalUnmount,
199
- }, children: jsx(Modal, { children: jsxs(ModalCard, { children: [jsx(ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsx(IconWithSpinner, { Icon: (props) => (jsx(Icon, { color: 'brand-primary', children: jsx(SvgSignCircle, Object.assign({}, props)) })), iconSize: 64, isSpinning: true }) }), jsx(PasskeyCreatedSuccessBanner, {}), jsxs("div", { className: 'sign-message-confirmation__body', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'sign-message-confirmation__title', copykey: 'dyn_sign_message.title', children: t('dyn_sign_message.title') }), jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: signMessageError && (jsx("div", { className: 'sign-message-confirmation__error', children: jsx(ErrorContainer, { children: errorText }) })) }), jsxs("div", { className: 'sign-message-confirmation__message-container', children: [jsx(AppOriginTile, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: PlatformService.getDisplayOrigin() }), jsx("div", { className: 'sign-message-confirmation__message', children: jsx(SignMessagePreview
200
- // strip if entire message is a quote and replace escaped newlines
201
- , {
199
+ }, children: jsx(Modal, { children: jsxs(ModalCard, { children: [jsx(ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsx(IconWithSpinner, { Icon: (props) => (jsx(Icon, { color: 'brand-primary', children: jsx(SvgSignCircle, Object.assign({}, props)) })), iconSize: 64, isSpinning: true }) }), jsx(PasskeyCreatedSuccessBanner, {}), jsxs("div", { className: 'sign-message-confirmation__body', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'sign-message-confirmation__title', copykey: 'dyn_sign_message.title', children: t('dyn_sign_message.title') }), jsx(AppOriginTile, {}), jsx(Typography, { variant: 'body_normal', color: 'secondary', className: 'sign-message-confirmation__warning', copykey: 'dyn_sign_message.warning', children: t('dyn_sign_message.warning') }), jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: signMessageError && (jsx("div", { className: 'sign-message-confirmation__error', children: jsx(ErrorContainer, { children: errorText }) })) }), jsxs("div", { className: 'sign-message-confirmation__message-container-wrapper', children: [jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'bold', className: 'sign-message-confirmation__message-container-label', copykey: 'dyn_sign_message.message_label', children: t('dyn_sign_message.message_label') }), jsx("div", { className: 'sign-message-confirmation__message-container', children: jsx("div", { className: 'sign-message-confirmation__message', children: jsx(SignMessagePreview
202
200
  // strip if entire message is a quote and replace escaped newlines
203
- message: message
204
- .toString()
205
- .replace(/^"(.*)"$/, '$1')
206
- .replace(/\\n/g, '\n') }) })] }), jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsx(TypographyButton, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, copykey: 'dyn_sign_message.cancel_button', children: t('dyn_sign_message.cancel_button') }), jsx(TypographyButton, { buttonVariant: 'primary', buttonPadding: 'large', onClick: handleMessageSign, expanded: true, loading: isLoading, copykey: 'dyn_sign_message.sign_button', dataTestId: 'sign-button', children: t('dyn_sign_message.sign_button') })] }), jsx(NeedHelpSection, {}), jsx(PoweredByDynamic, {})] })] }) }) }));
201
+ , {
202
+ // strip if entire message is a quote and replace escaped newlines
203
+ message: message
204
+ .toString()
205
+ .replace(/^"(.*)"$/, '$1')
206
+ .replace(/\\n/g, '\n') }) }) })] }), jsxs("div", { className: 'sign-message-confirmation__actions', children: [jsx(TypographyButton, { buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', disabled: isLoading, copykey: 'dyn_sign_message.cancel_button', children: t('dyn_sign_message.cancel_button') }), jsx(TypographyButton, { buttonVariant: 'primary', buttonPadding: 'large', onClick: handleMessageSign, expanded: true, loading: isLoading, copykey: 'dyn_sign_message.sign_button', dataTestId: 'sign-button', children: t('dyn_sign_message.sign_button') })] }), jsx(NeedHelpSection, {}), jsx(PoweredByDynamic, {})] })] }) }) }));
207
207
  };
208
208
 
209
209
  export { SignMessageConfirmationModal };
@@ -0,0 +1,15 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const getGlobalWalletContext = () => {
7
+ if (typeof window === 'undefined' ||
8
+ !window.isGlobalWalletPopup ||
9
+ !window.globalWalletContext) {
10
+ return {};
11
+ }
12
+ return window.globalWalletContext;
13
+ };
14
+
15
+ exports.getGlobalWalletContext = getGlobalWalletContext;
@@ -0,0 +1,11 @@
1
+ declare global {
2
+ interface Window {
3
+ isGlobalWalletPopup: boolean;
4
+ globalWalletContext: {
5
+ requesterOrigin: string;
6
+ };
7
+ }
8
+ }
9
+ export declare const getGlobalWalletContext: () => {
10
+ requesterOrigin?: string;
11
+ };
@@ -0,0 +1,11 @@
1
+ 'use client'
2
+ const getGlobalWalletContext = () => {
3
+ if (typeof window === 'undefined' ||
4
+ !window.isGlobalWalletPopup ||
5
+ !window.globalWalletContext) {
6
+ return {};
7
+ }
8
+ return window.globalWalletContext;
9
+ };
10
+
11
+ export { getGlobalWalletContext };
@@ -0,0 +1 @@
1
+ export { getGlobalWalletContext } from './getGlobalWalletContext';
@@ -6,6 +6,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  const shortenWalletAddress = (walletAddress, first = 6, last = 4) => {
7
7
  if (!walletAddress)
8
8
  return '';
9
+ if (walletAddress.length <= first + last)
10
+ return walletAddress;
9
11
  return walletAddress.replace(walletAddress.substring(first, Number(walletAddress.length) - last), '...');
10
12
  };
11
13
 
@@ -2,6 +2,8 @@
2
2
  const shortenWalletAddress = (walletAddress, first = 6, last = 4) => {
3
3
  if (!walletAddress)
4
4
  return '';
5
+ if (walletAddress.length <= first + last)
6
+ return walletAddress;
5
7
  return walletAddress.replace(walletAddress.substring(first, Number(walletAddress.length) - last), '...');
6
8
  };
7
9