@dynamic-labs/sdk-react-core 0.17.0-RC.16 → 0.17.0-RC.17

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 (94) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +8 -8
  5. package/src/lib/components/Divider/Divider.cjs +4 -1
  6. package/src/lib/components/Divider/Divider.d.ts +6 -2
  7. package/src/lib/components/Divider/Divider.js +4 -1
  8. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +40 -0
  9. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.d.ts +17 -0
  10. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +36 -0
  11. package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.cjs +11 -0
  12. package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.d.ts +12 -0
  13. package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.js +7 -0
  14. package/src/lib/components/TransactionConfirmationPageLayout/components/TransactionRow/index.d.ts +1 -0
  15. package/src/lib/components/TransactionConfirmationPageLayout/components/index.d.ts +1 -0
  16. package/src/lib/components/TransactionConfirmationPageLayout/index.d.ts +2 -0
  17. package/src/lib/components/index.d.ts +1 -0
  18. package/src/lib/context/DynamicContext/DynamicContext.cjs +19 -7
  19. package/src/lib/context/DynamicContext/DynamicContext.d.ts +2 -0
  20. package/src/lib/context/DynamicContext/DynamicContext.js +19 -7
  21. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +1 -0
  22. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +1 -0
  23. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +18 -25
  24. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +18 -25
  25. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.types.d.ts +0 -1
  26. package/src/lib/shared/types/index.d.ts +1 -1
  27. package/src/lib/styles/index.shadow.cjs +1 -1
  28. package/src/lib/styles/index.shadow.js +1 -1
  29. package/src/lib/utils/functions/isWalletLinked/index.d.ts +1 -0
  30. package/src/lib/utils/functions/isWalletLinked/isWalletLinked.cjs +15 -0
  31. package/src/lib/utils/functions/isWalletLinked/isWalletLinked.d.ts +2 -0
  32. package/src/lib/utils/functions/isWalletLinked/isWalletLinked.js +11 -0
  33. package/src/lib/utils/hooks/multiWallet/index.d.ts +1 -0
  34. package/src/lib/utils/hooks/multiWallet/useMultiWalletWidgetState/useMultiWalletWidgetState.cjs +0 -2
  35. package/src/lib/utils/hooks/multiWallet/useMultiWalletWidgetState/useMultiWalletWidgetState.js +0 -2
  36. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +53 -6
  37. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.d.ts +8 -1
  38. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +54 -7
  39. package/src/lib/utils/hooks/useConnectedAccountWallet/index.d.ts +1 -0
  40. package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.cjs +30 -0
  41. package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.d.ts +2 -0
  42. package/src/lib/utils/hooks/useConnectedAccountWallet/useConnectedAccountWallet.js +26 -0
  43. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +18 -6
  44. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +18 -6
  45. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +4 -5
  46. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +4 -5
  47. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +2 -1
  48. package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +2 -1
  49. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.cjs +15 -5
  50. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetPrompts/DynamicWidgetPrompts.js +15 -5
  51. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +2 -1
  52. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +2 -1
  53. package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.cjs +38 -6
  54. package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.d.ts +2 -1
  55. package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +39 -7
  56. package/src/lib/widgets/DynamicWidget/{components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs → prompts/DefaultPromptModal/DefaultPromptModal.cjs} +6 -13
  57. package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.d.ts +13 -0
  58. package/src/lib/widgets/DynamicWidget/{components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js → prompts/DefaultPromptModal/DefaultPromptModal.js} +6 -13
  59. package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +1 -1
  60. package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +1 -1
  61. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.cjs +17 -42
  62. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/PendingAccountSwitchModal.js +18 -43
  63. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +40 -0
  64. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.d.ts +7 -0
  65. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +36 -0
  66. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/index.d.ts +1 -0
  67. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +67 -0
  68. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.d.ts +8 -0
  69. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +63 -0
  70. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/index.d.ts +1 -0
  71. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +57 -0
  72. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.d.ts +2 -0
  73. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +53 -0
  74. package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/index.d.ts +1 -0
  75. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +44 -0
  76. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.d.ts +2 -0
  77. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +40 -0
  78. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/index.d.ts +1 -0
  79. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +64 -0
  80. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.d.ts +2 -0
  81. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +60 -0
  82. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.cjs +2 -33
  83. package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/PendingSignModal.js +2 -33
  84. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +4 -6
  85. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +5 -7
  86. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +1 -1
  87. package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +1 -1
  88. package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.d.ts +0 -2
  89. package/src/lib/widgets/DynamicWidget/components/DefaultPendingSignModalContent/DefaultPendingSignModalContent.types.d.ts +0 -7
  90. package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.cjs +0 -61
  91. package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.d.ts +0 -7
  92. package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/DetectedKnownSecondaryWalletModal.js +0 -57
  93. package/src/lib/widgets/DynamicWidget/prompts/DetectedKnownSecondaryWalletModal/index.d.ts +0 -1
  94. /package/src/lib/widgets/DynamicWidget/{components → prompts/PendingSignModal}/DefaultPendingSignModalContent/index.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,4 +1,24 @@
1
1
 
2
+ ## [0.17.0-RC.17](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.16...v0.17.0-RC.17) (2023-05-17)
3
+
4
+
5
+ ### Features
6
+
7
+ * distinguish walletconnect deeplink types ([#2093](https://github.com/dynamic-labs/DynamicAuth/issues/2093)) ([dcd29f7](https://github.com/dynamic-labs/DynamicAuth/commit/dcd29f7cfc5e6481aaaae502b3fc4e4d225f1fc1))
8
+ * **social:** pass did token to verify request ([#2124](https://github.com/dynamic-labs/DynamicAuth/issues/2124)) ([60d73a5](https://github.com/dynamic-labs/DynamicAuth/commit/60d73a5f432d488979f33fe29666d1afa8fc0e8e))
9
+ * support optional priority and stalltimeout for customer provided rpc urls ([#2091](https://github.com/dynamic-labs/DynamicAuth/issues/2091)) ([eebacda](https://github.com/dynamic-labs/DynamicAuth/commit/eebacda6a9d6ba583eff4e4e5a38eb9945c4825e))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * add and remove event listeners for Solflare ([#2127](https://github.com/dynamic-labs/DynamicAuth/issues/2127)) ([978c7ba](https://github.com/dynamic-labs/DynamicAuth/commit/978c7ba0e3745e26d9dfc9b7c46a24adc913f02f))
15
+ * get publicKey from provider if no address and publicKey are returned on connect ([#2126](https://github.com/dynamic-labs/DynamicAuth/issues/2126)) ([c9c9b2a](https://github.com/dynamic-labs/DynamicAuth/commit/c9c9b2af81f660aa651fc4b0e01cd3c823bb0229))
16
+ * remove detect known secondary wallet modal ([#2117](https://github.com/dynamic-labs/DynamicAuth/issues/2117)) ([0e8bbd8](https://github.com/dynamic-labs/DynamicAuth/commit/0e8bbd8c385fe528a7af3ccc037812df9d6e0c84))
17
+ * revert changes for select wallet to work with solflare ([#2120](https://github.com/dynamic-labs/DynamicAuth/issues/2120)) ([76cf228](https://github.com/dynamic-labs/DynamicAuth/commit/76cf228c495d6592da4c88b8a0d5a5fc480861ae))
18
+ * setIsVerifying to false when selecting a connector ([#2133](https://github.com/dynamic-labs/DynamicAuth/issues/2133)) ([8ddeba3](https://github.com/dynamic-labs/DynamicAuth/commit/8ddeba377f35dfb4a104cd6bd7ee6315d574710f))
19
+ * setPrimaryWallet and useSyncPrimaryWallet updates ([#2128](https://github.com/dynamic-labs/DynamicAuth/issues/2128)) ([fb47b17](https://github.com/dynamic-labs/DynamicAuth/commit/fb47b17ddc7f41c29f140a1a85a1e47dbf017fff))
20
+ * update text color and add close button on extension not installed prompt ([#2122](https://github.com/dynamic-labs/DynamicAuth/issues/2122)) ([b4848a0](https://github.com/dynamic-labs/DynamicAuth/commit/b4848a0a8094b4ceac67e2667d277a9aa5e2e137))
21
+
2
22
  ## [0.17.0-RC.16](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0-RC.15...v0.17.0-RC.16) (2023-05-15)
3
23
 
4
24
 
package/package.cjs CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "0.17.0-RC.16";
5
+ var version = "0.17.0-RC.17";
6
6
  var dependencies = {
7
7
  "react-focus-lock": "^2.9.2",
8
8
  "@dynamic-labs/iconic": "^0.1.19",
9
- "@dynamic-labs/sdk-api": "0.0.192",
9
+ "@dynamic-labs/sdk-api": "0.0.195",
10
10
  "@dynamic-labs/wallet-book": "^0.0.15",
11
11
  "@hcaptcha/react-hcaptcha": "~1.4.4",
12
12
  "country-list": "^2.3.0",
package/package.js CHANGED
@@ -1,8 +1,8 @@
1
- var version = "0.17.0-RC.16";
1
+ var version = "0.17.0-RC.17";
2
2
  var dependencies = {
3
3
  "react-focus-lock": "^2.9.2",
4
4
  "@dynamic-labs/iconic": "^0.1.19",
5
- "@dynamic-labs/sdk-api": "0.0.192",
5
+ "@dynamic-labs/sdk-api": "0.0.195",
6
6
  "@dynamic-labs/wallet-book": "^0.0.15",
7
7
  "@hcaptcha/react-hcaptcha": "~1.4.4",
8
8
  "country-list": "^2.3.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "0.17.0-RC.16",
3
+ "version": "0.17.0-RC.17",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -9,7 +9,7 @@
9
9
  "dependencies": {
10
10
  "react-focus-lock": "^2.9.2",
11
11
  "@dynamic-labs/iconic": "^0.1.19",
12
- "@dynamic-labs/sdk-api": "0.0.192",
12
+ "@dynamic-labs/sdk-api": "0.0.195",
13
13
  "@dynamic-labs/wallet-book": "^0.0.15",
14
14
  "@hcaptcha/react-hcaptcha": "~1.4.4",
15
15
  "country-list": "^2.3.0",
@@ -17,12 +17,12 @@
17
17
  "formik": "^2.2.9",
18
18
  "qrcode": "1.5.1",
19
19
  "ethers": "^5.7.2",
20
- "@dynamic-labs/logger": "0.17.0-RC.16",
21
- "@dynamic-labs/multi-wallet": "0.17.0-RC.16",
22
- "@dynamic-labs/rpc-providers": "0.17.0-RC.16",
23
- "@dynamic-labs/types": "0.17.0-RC.16",
24
- "@dynamic-labs/utils": "0.17.0-RC.16",
25
- "@dynamic-labs/wallet-connector-core": "0.17.0-RC.16"
20
+ "@dynamic-labs/logger": "0.17.0-RC.17",
21
+ "@dynamic-labs/multi-wallet": "0.17.0-RC.17",
22
+ "@dynamic-labs/rpc-providers": "0.17.0-RC.17",
23
+ "@dynamic-labs/types": "0.17.0-RC.17",
24
+ "@dynamic-labs/utils": "0.17.0-RC.17",
25
+ "@dynamic-labs/wallet-connector-core": "0.17.0-RC.17"
26
26
  },
27
27
  "devDependencies": {
28
28
  "semver": "^7.3.8"
@@ -18,6 +18,7 @@ require('../../context/DynamicContext/DynamicContext.cjs');
18
18
  require('@dynamic-labs/multi-wallet');
19
19
  require('../ShadowDOM/ShadowDOM.cjs');
20
20
  require('../../context/ThemeContext/ThemeContext.cjs');
21
+ var classNames = require('../../utils/functions/classNames/classNames.cjs');
21
22
  require('react-dom');
22
23
  require('react-focus-lock');
23
24
  require('../Transition/ZoomTransition/ZoomTransition.cjs');
@@ -34,6 +35,8 @@ require('../Alert/Alert.cjs');
34
35
  require('../Popper/Popper/Popper.cjs');
35
36
  require('../Popper/PopperContext/PopperContext.cjs');
36
37
 
37
- const Divider = ({ text }) => (jsxRuntime.jsxs("div", Object.assign({ className: 'divider' }, { children: [jsxRuntime.jsx("div", { className: 'divider__dash' }), jsxRuntime.jsx(Typography.Typography, Object.assign({ className: 'divider__text', variant: 'body_small', color: 'secondary' }, { children: text })), jsxRuntime.jsx("div", { className: 'divider__dash' })] })));
38
+ const Divider = ({ text, className = '', fullWidth = false }) => (jsxRuntime.jsxs("div", Object.assign({ className: classNames.classNames('divider', className, {
39
+ 'divider__full-width': fullWidth,
40
+ }) }, { children: [jsxRuntime.jsx("div", { className: 'divider__dash' }), jsxRuntime.jsx(Typography.Typography, Object.assign({ className: 'divider__text', variant: 'body_small', color: 'secondary' }, { children: text })), jsxRuntime.jsx("div", { className: 'divider__dash' })] })));
38
41
 
39
42
  exports.Divider = Divider;
@@ -1,4 +1,8 @@
1
1
  /// <reference types="react" />
2
- export declare const Divider: ({ text }: {
2
+ type Props = {
3
+ className?: string;
4
+ fullWidth?: boolean;
3
5
  text: string;
4
- }) => JSX.Element;
6
+ };
7
+ export declare const Divider: ({ text, className, fullWidth }: Props) => JSX.Element;
8
+ export {};
@@ -14,6 +14,7 @@ import '../../context/DynamicContext/DynamicContext.js';
14
14
  import '@dynamic-labs/multi-wallet';
15
15
  import '../ShadowDOM/ShadowDOM.js';
16
16
  import '../../context/ThemeContext/ThemeContext.js';
17
+ import { classNames } from '../../utils/functions/classNames/classNames.js';
17
18
  import 'react-dom';
18
19
  import 'react-focus-lock';
19
20
  import '../Transition/ZoomTransition/ZoomTransition.js';
@@ -30,6 +31,8 @@ import '../Alert/Alert.js';
30
31
  import '../Popper/Popper/Popper.js';
31
32
  import '../Popper/PopperContext/PopperContext.js';
32
33
 
33
- const Divider = ({ text }) => (jsxs("div", Object.assign({ className: 'divider' }, { children: [jsx("div", { className: 'divider__dash' }), jsx(Typography, Object.assign({ className: 'divider__text', variant: 'body_small', color: 'secondary' }, { children: text })), jsx("div", { className: 'divider__dash' })] })));
34
+ const Divider = ({ text, className = '', fullWidth = false }) => (jsxs("div", Object.assign({ className: classNames('divider', className, {
35
+ 'divider__full-width': fullWidth,
36
+ }) }, { children: [jsx("div", { className: 'divider__dash' }), jsx(Typography, Object.assign({ className: 'divider__text', variant: 'body_small', color: 'secondary' }, { children: text })), jsx("div", { className: 'divider__dash' })] })));
34
37
 
35
38
  export { Divider };
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var ModalHeader = require('../ModalHeader/ModalHeader.cjs');
7
+ var IconWithSpinner = require('../IconWithSpinner/IconWithSpinner.cjs');
8
+ var Icon = require('../Icon/Icon.cjs');
9
+ require('@dynamic-labs/sdk-api');
10
+ require('../../shared/logger.cjs');
11
+ require('@dynamic-labs/iconic');
12
+ require('@dynamic-labs/wallet-connector-core');
13
+ require('../../context/ViewContext/ViewContext.cjs');
14
+ require('react');
15
+ var close = require('../../shared/assets/close.cjs');
16
+ var chevronLeft = require('../../shared/assets/chevron-left.cjs');
17
+ var signCircle = require('../../shared/assets/sign-circle.cjs');
18
+ require('@dynamic-labs/utils');
19
+ require('../../utils/constants/colors.cjs');
20
+ require('ethers');
21
+ require('../../shared/consts/index.cjs');
22
+ var IconButton = require('../IconButton/IconButton.cjs');
23
+ var Typography = require('../Typography/Typography.cjs');
24
+ var AnimatePresence = require('../AnimatePresence/AnimatePresence.cjs');
25
+ require('../Transition/ZoomTransition/ZoomTransition.cjs');
26
+ require('../Transition/SlideInUpTransition/SlideInUpTransition.cjs');
27
+ require('../Transition/OpacityTransition/OpacityTransition.cjs');
28
+ var VerticalDrawerTransition = require('../Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs');
29
+ var Alert = require('../Alert/Alert.cjs');
30
+ var AppOriginTile = require('../AppOriginTile/AppOriginTile.cjs');
31
+ var Button = require('../Button/Button.cjs');
32
+ var PoweredByDynamic = require('../PoweredByDynamic/PoweredByDynamic.cjs');
33
+
34
+ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBack, title, error, appOrigin, appLogoUrl, appName, onClickSend, disableSendButton, displayPoweredByDynamicFooter = false, warningMessage, children, }) => {
35
+ const closeButton = onClickClose && (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: onClickClose, "data-testid": 'close', disabled: isLoading }, { children: jsxRuntime.jsx(close.ReactComponent, {}) })));
36
+ const backButton = onClickBack && (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: onClickBack, "data-testid": 'back-button' }, { children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) })));
37
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ trailing: closeButton, leading: backButton, alignContent: 'bottom' }, { children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: (props) => (jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'brand-primary' }, { children: jsxRuntime.jsx(signCircle.ReactComponent, Object.assign({}, props)) }))), iconSize: 64, isSpinning: true }) })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__body' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'title', color: 'primary', className: 'transaction-confirmation__title' }, { children: title })), jsxRuntime.jsx(AnimatePresence.AnimatePresence, Object.assign({ animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}) }, { children: error && (jsxRuntime.jsx("div", Object.assign({ className: 'transaction-confirmation__error' }, { children: jsxRuntime.jsx(Alert.Alert, Object.assign({ icon: 'error', variant: 'error' }, { children: error })) }))) })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__content' }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'transaction-confirmation__app-origin-tile' }, { children: jsxRuntime.jsx(AppOriginTile.AppOriginTile, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: appOrigin }) })), jsxRuntime.jsx("div", Object.assign({ className: 'transaction-confirmation__rows' }, { children: children }))] })), jsxRuntime.jsx(AnimatePresence.AnimatePresence, Object.assign({ animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}) }, { children: warningMessage && (jsxRuntime.jsx("div", Object.assign({ className: 'transaction-confirmation__warning' }, { children: jsxRuntime.jsx(Alert.Alert, Object.assign({ icon: 'error', variant: 'warning', contentDataTestId: 'warning_content' }, { children: warningMessage })) }))) })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__actions' }, { children: [onClickClose && (jsxRuntime.jsx(Button.Button, Object.assign({ buttonVariant: 'secondary', onClick: onClickClose, expanded: true, buttonPadding: 'large', buttonRounded: 'default', disabled: isLoading }, { children: "Cancel" }))), jsxRuntime.jsx(Button.Button, Object.assign({ buttonVariant: 'primary', buttonPadding: 'large', onClick: onClickSend, expanded: true, buttonRounded: 'default', loading: isLoading, disabled: disableSendButton }, { children: "Send" }))] })), displayPoweredByDynamicFooter && (jsxRuntime.jsx("div", Object.assign({ className: 'transaction-confirmation__footer' }, { children: jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {}) })))] }))] }));
38
+ };
39
+
40
+ exports.TransactionConfirmationPageLayout = TransactionConfirmationPageLayout;
@@ -0,0 +1,17 @@
1
+ import { FC, MouseEventHandler, PropsWithChildren, ReactNode } from 'react';
2
+ type TransactionConfirmationPageLayoutProps = {
3
+ appLogoUrl?: string;
4
+ appName?: string;
5
+ appOrigin: string;
6
+ disableSendButton?: boolean;
7
+ displayPoweredByDynamicFooter?: boolean;
8
+ error?: string;
9
+ isLoading: boolean;
10
+ onClickBack?: MouseEventHandler<HTMLButtonElement>;
11
+ onClickClose?: MouseEventHandler<HTMLButtonElement>;
12
+ onClickSend: MouseEventHandler<HTMLButtonElement>;
13
+ title?: ReactNode;
14
+ warningMessage?: string;
15
+ };
16
+ export declare const TransactionConfirmationPageLayout: FC<PropsWithChildren<TransactionConfirmationPageLayoutProps>>;
17
+ export {};
@@ -0,0 +1,36 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { ModalHeader } from '../ModalHeader/ModalHeader.js';
3
+ import { IconWithSpinner } from '../IconWithSpinner/IconWithSpinner.js';
4
+ import { Icon } from '../Icon/Icon.js';
5
+ import '@dynamic-labs/sdk-api';
6
+ import '../../shared/logger.js';
7
+ import '@dynamic-labs/iconic';
8
+ import '@dynamic-labs/wallet-connector-core';
9
+ import '../../context/ViewContext/ViewContext.js';
10
+ import 'react';
11
+ import { ReactComponent as SvgClose } from '../../shared/assets/close.js';
12
+ import { ReactComponent as SvgChevronLeft } from '../../shared/assets/chevron-left.js';
13
+ import { ReactComponent as SvgSignCircle } from '../../shared/assets/sign-circle.js';
14
+ import '@dynamic-labs/utils';
15
+ import '../../utils/constants/colors.js';
16
+ import 'ethers';
17
+ import '../../shared/consts/index.js';
18
+ import { IconButton } from '../IconButton/IconButton.js';
19
+ import { Typography } from '../Typography/Typography.js';
20
+ import { AnimatePresence } from '../AnimatePresence/AnimatePresence.js';
21
+ import '../Transition/ZoomTransition/ZoomTransition.js';
22
+ import '../Transition/SlideInUpTransition/SlideInUpTransition.js';
23
+ import '../Transition/OpacityTransition/OpacityTransition.js';
24
+ import { VerticalDrawerTransition } from '../Transition/VerticalDrawerTransition/VerticalDrawerTransition.js';
25
+ import { Alert } from '../Alert/Alert.js';
26
+ import { AppOriginTile } from '../AppOriginTile/AppOriginTile.js';
27
+ import { Button } from '../Button/Button.js';
28
+ import { PoweredByDynamic } from '../PoweredByDynamic/PoweredByDynamic.js';
29
+
30
+ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBack, title, error, appOrigin, appLogoUrl, appName, onClickSend, disableSendButton, displayPoweredByDynamicFooter = false, warningMessage, children, }) => {
31
+ const closeButton = onClickClose && (jsx(IconButton, Object.assign({ type: 'button', onClick: onClickClose, "data-testid": 'close', disabled: isLoading }, { children: jsx(SvgClose, {}) })));
32
+ const backButton = onClickBack && (jsx(IconButton, Object.assign({ type: 'button', onClick: onClickBack, "data-testid": 'back-button' }, { children: jsx(SvgChevronLeft, {}) })));
33
+ return (jsxs(Fragment, { children: [jsx(ModalHeader, Object.assign({ trailing: closeButton, leading: backButton, alignContent: 'bottom' }, { children: jsx(IconWithSpinner, { Icon: (props) => (jsx(Icon, Object.assign({ color: 'brand-primary' }, { children: jsx(SvgSignCircle, Object.assign({}, props)) }))), iconSize: 64, isSpinning: true }) })), jsxs("div", Object.assign({ className: 'transaction-confirmation__body' }, { children: [jsx(Typography, Object.assign({ variant: 'title', color: 'primary', className: 'transaction-confirmation__title' }, { children: title })), jsx(AnimatePresence, Object.assign({ animationComponent: jsx(VerticalDrawerTransition, {}) }, { children: error && (jsx("div", Object.assign({ className: 'transaction-confirmation__error' }, { children: jsx(Alert, Object.assign({ icon: 'error', variant: 'error' }, { children: error })) }))) })), jsxs("div", Object.assign({ className: 'transaction-confirmation__content' }, { children: [jsx("div", Object.assign({ className: 'transaction-confirmation__app-origin-tile' }, { children: jsx(AppOriginTile, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: appOrigin }) })), jsx("div", Object.assign({ className: 'transaction-confirmation__rows' }, { children: children }))] })), jsx(AnimatePresence, Object.assign({ animationComponent: jsx(VerticalDrawerTransition, {}) }, { children: warningMessage && (jsx("div", Object.assign({ className: 'transaction-confirmation__warning' }, { children: jsx(Alert, Object.assign({ icon: 'error', variant: 'warning', contentDataTestId: 'warning_content' }, { children: warningMessage })) }))) })), jsxs("div", Object.assign({ className: 'transaction-confirmation__actions' }, { children: [onClickClose && (jsx(Button, Object.assign({ buttonVariant: 'secondary', onClick: onClickClose, expanded: true, buttonPadding: 'large', buttonRounded: 'default', disabled: isLoading }, { children: "Cancel" }))), jsx(Button, Object.assign({ buttonVariant: 'primary', buttonPadding: 'large', onClick: onClickSend, expanded: true, buttonRounded: 'default', loading: isLoading, disabled: disableSendButton }, { children: "Send" }))] })), displayPoweredByDynamicFooter && (jsx("div", Object.assign({ className: 'transaction-confirmation__footer' }, { children: jsx(PoweredByDynamic, {}) })))] }))] }));
34
+ };
35
+
36
+ export { TransactionConfirmationPageLayout };
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var Typography = require('../../../Typography/Typography.cjs');
7
+ var Skeleton = require('../../../Skeleton/Skeleton.cjs');
8
+
9
+ const TransactionRow = ({ label, title, children, isEmpty = false, isLoading = false, suffix, dataTestId, icon, }) => (jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-row' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-row__label' }, { children: label })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-row__content', "data-testid": dataTestId }, { children: [isLoading && (jsxRuntime.jsx(Skeleton.Skeleton, { count: 1, className: 'transaction-row__skeleton' })), isLoading === false && children !== undefined && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ title: title, color: isEmpty ? 'secondary' : 'primary', variant: 'body_normal', weight: isEmpty ? 'regular' : 'medium', truncate: true }, { children: children })), suffix && (jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', color: 'secondary', weight: 'regular' }, { children: suffix }))), icon] }))] }))] })));
10
+
11
+ exports.TransactionRow = TransactionRow;
@@ -0,0 +1,12 @@
1
+ import { FC, PropsWithChildren, ReactNode } from 'react';
2
+ type TransactionRowProps = {
3
+ dataTestId?: string;
4
+ icon?: ReactNode;
5
+ isEmpty?: boolean;
6
+ isLoading?: boolean;
7
+ label: ReactNode;
8
+ suffix?: ReactNode;
9
+ title?: string;
10
+ };
11
+ export declare const TransactionRow: FC<PropsWithChildren<TransactionRowProps>>;
12
+ export {};
@@ -0,0 +1,7 @@
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import { Typography } from '../../../Typography/Typography.js';
3
+ import { Skeleton } from '../../../Skeleton/Skeleton.js';
4
+
5
+ const TransactionRow = ({ label, title, children, isEmpty = false, isLoading = false, suffix, dataTestId, icon, }) => (jsxs("div", Object.assign({ className: 'transaction-row' }, { children: [jsx(Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-row__label' }, { children: label })), jsxs("div", Object.assign({ className: 'transaction-row__content', "data-testid": dataTestId }, { children: [isLoading && (jsx(Skeleton, { count: 1, className: 'transaction-row__skeleton' })), isLoading === false && children !== undefined && (jsxs(Fragment, { children: [jsx(Typography, Object.assign({ title: title, color: isEmpty ? 'secondary' : 'primary', variant: 'body_normal', weight: isEmpty ? 'regular' : 'medium', truncate: true }, { children: children })), suffix && (jsx(Typography, Object.assign({ as: 'span', color: 'secondary', weight: 'regular' }, { children: suffix }))), icon] }))] }))] })));
6
+
7
+ export { TransactionRow };
@@ -0,0 +1 @@
1
+ export { TransactionRow } from './TransactionRow';
@@ -0,0 +1 @@
1
+ export * from './TransactionRow';
@@ -0,0 +1,2 @@
1
+ export { TransactionConfirmationPageLayout } from './TransactionConfirmationPageLayout';
2
+ export { TransactionRow } from './components';
@@ -35,3 +35,4 @@ export * from './OTPVerificationView';
35
35
  export * from './IconListTile';
36
36
  export * from './Transition';
37
37
  export * from './Popper';
38
+ export * from './TransactionConfirmationPageLayout';
@@ -35,9 +35,9 @@ var ApiEndpoint = require('../../config/ApiEndpoint.cjs');
35
35
  var ThemeContext = require('../ThemeContext/ThemeContext.cjs');
36
36
  var useFetchNetworkConfigurations = require('../../utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.cjs');
37
37
  var useMultiWalletWidgetState = require('../../utils/hooks/multiWallet/useMultiWalletWidgetState/useMultiWalletWidgetState.cjs');
38
+ var useSyncPrimaryWallet = require('../../utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs');
38
39
  var useWalletEventListeners = require('../../utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs');
39
40
  var LoadingContext = require('../LoadingContext/LoadingContext.cjs');
40
- var useSyncPrimaryWallet = require('../../utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs');
41
41
  var useFetchWalletsForChainsMap = require('../../utils/hooks/useFetchWalletsForChainsMap/useFetchWalletsForChainsMap.cjs');
42
42
  var useHandleUnlinkWallet = require('../../utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.cjs');
43
43
  var app = require('../../app.cjs');
@@ -98,6 +98,8 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
98
98
  const [isVerifying, setIsVerifying] = React.useState(false);
99
99
  const { projectSettings, isLoading: isProjectSettingsLoading } = useFetchProjectSettings.useFetchProjectSettings({ authToken: getAuthToken.getAuthToken(), environmentId });
100
100
  const multiWallet = (_c = deprecatedMultiWallet !== null && deprecatedMultiWallet !== void 0 ? deprecatedMultiWallet : (_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.multiWallet) !== null && _c !== void 0 ? _c : false;
101
+ // ensures that when user comes back to site and primary wallet is out of sync, we don't show widget popup
102
+ const [showWidgetStatePopup, setShowWidgetStatePopup] = React.useState(!multiWallet);
101
103
  const { configurations: serverNetworkConfigurations, handleRemoveLsNetworks, } = useFetchNetworkConfigurations.useFetchNetworkConfigurations({
102
104
  authToken: getAuthToken.getAuthToken(),
103
105
  environmentId,
@@ -152,11 +154,6 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
152
154
  currentWallet: primaryWallet !== null && primaryWallet !== void 0 ? primaryWallet : connectedWallet,
153
155
  });
154
156
  const walletForUserFacingContext = authMode === 'connect-and-sign' || user ? primaryWallet : connectedWallet;
155
- useSyncPrimaryWallet.useSyncPrimaryWallet({
156
- multiWalletWidgetState,
157
- primaryWallet,
158
- setMultiWalletWidgetState,
159
- });
160
157
  const { clearAllWalletConnectSessions, clearOphanedWalletConnectSessions } = useClearWalletConnectSessions.useClearWalletConnectSessions({
161
158
  connectors: walletConnectors,
162
159
  });
@@ -200,6 +197,17 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
200
197
  environmentId,
201
198
  walletConnectors,
202
199
  ]);
200
+ useSyncPrimaryWallet.useSyncPrimaryWallet({
201
+ computeConnectedStateForWallets,
202
+ handleLogOut,
203
+ multiWalletWidgetState,
204
+ primaryWallet,
205
+ secondaryWallets,
206
+ setMultiWalletWidgetState,
207
+ setPrimaryWallet,
208
+ setShowWidgetStatePopup,
209
+ showWidgetStatePopup,
210
+ });
203
211
  const handleUnlinkWallet = useHandleUnlinkWallet.useHandleUnlinkWallet({
204
212
  environmentId,
205
213
  primaryWalletId,
@@ -350,11 +358,13 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
350
358
  setShowAuthFlow,
351
359
  setShowDynamicUserProfile,
352
360
  setShowQrcodeModal,
361
+ setShowWidgetStatePopup,
353
362
  setUser,
354
363
  shadowDOMEnabled,
355
364
  showAuthFlow,
356
365
  showDynamicUserProfile,
357
366
  showQrcodeModal,
367
+ showWidgetStatePopup,
358
368
  signWithEmailWalletName,
359
369
  siweStatement,
360
370
  socialMediaIconUrl: ((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _a === void 0 ? void 0 : _a.supportUrls) || socialMediaIconUrl,
@@ -437,6 +447,7 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
437
447
  showAuthFlow,
438
448
  showDynamicUserProfile,
439
449
  showQrcodeModal,
450
+ showWidgetStatePopup,
440
451
  signWithEmailWalletName,
441
452
  siweStatement,
442
453
  socialMediaIconUrl,
@@ -470,8 +481,9 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
470
481
  // DYN-1140 - Opens Widget when multiWalletWidgetState changes
471
482
  React.useEffect(() => {
472
483
  // If statement to secure SingleWallet widget
473
- if (!multiWallet)
484
+ if (!multiWallet && multiWalletWidgetState !== 'awaiting_account_switch') {
474
485
  return;
486
+ }
475
487
  // We need to make sure that the user is logged in so that we do not try to display the widget before authorization
476
488
  if (user && multiWalletWidgetState !== 'idle' && !showDynamicUserProfile) {
477
489
  setShowDynamicUserProfile(true);
@@ -79,11 +79,13 @@ export interface IDynamicContext {
79
79
  setShowAuthFlow: Dispatch<SetStateAction<boolean>>;
80
80
  setShowDynamicUserProfile: Dispatch<SetStateAction<boolean>>;
81
81
  setShowQrcodeModal: Dispatch<SetStateAction<boolean>>;
82
+ setShowWidgetStatePopup: Dispatch<SetStateAction<boolean>>;
82
83
  setUser: Dispatch<SetStateAction<UserProfile | undefined>>;
83
84
  shadowDOMEnabled: boolean;
84
85
  showAuthFlow: boolean;
85
86
  showDynamicUserProfile: boolean;
86
87
  showQrcodeModal: boolean;
88
+ showWidgetStatePopup: boolean;
87
89
  signWithEmailWalletName?: string;
88
90
  siweStatement?: string;
89
91
  socialMediaIconUrl?: Record<string, string> | Record<SocialNetworkIconType, string>;
@@ -31,9 +31,9 @@ import ApiEndpoint from '../../config/ApiEndpoint.js';
31
31
  import { ThemeContextProvider } from '../ThemeContext/ThemeContext.js';
32
32
  import { useFetchNetworkConfigurations } from '../../utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.js';
33
33
  import { useMultiWalletWidgetState } from '../../utils/hooks/multiWallet/useMultiWalletWidgetState/useMultiWalletWidgetState.js';
34
+ import { useSyncPrimaryWallet } from '../../utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js';
34
35
  import { useWalletEventListeners } from '../../utils/hooks/useWalletEventListeners/useWalletEventListeners.js';
35
36
  import { LoadingContextProvider } from '../LoadingContext/LoadingContext.js';
36
- import { useSyncPrimaryWallet } from '../../utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js';
37
37
  import { useFetchWalletsForChainsMap } from '../../utils/hooks/useFetchWalletsForChainsMap/useFetchWalletsForChainsMap.js';
38
38
  import { useHandleUnlinkWallet } from '../../utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.js';
39
39
  import { DynamicAuthFlow } from '../../app.js';
@@ -94,6 +94,8 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
94
94
  const [isVerifying, setIsVerifying] = useState(false);
95
95
  const { projectSettings, isLoading: isProjectSettingsLoading } = useFetchProjectSettings({ authToken: getAuthToken(), environmentId });
96
96
  const multiWallet = (_c = deprecatedMultiWallet !== null && deprecatedMultiWallet !== void 0 ? deprecatedMultiWallet : (_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _b === void 0 ? void 0 : _b.multiWallet) !== null && _c !== void 0 ? _c : false;
97
+ // ensures that when user comes back to site and primary wallet is out of sync, we don't show widget popup
98
+ const [showWidgetStatePopup, setShowWidgetStatePopup] = useState(!multiWallet);
97
99
  const { configurations: serverNetworkConfigurations, handleRemoveLsNetworks, } = useFetchNetworkConfigurations({
98
100
  authToken: getAuthToken(),
99
101
  environmentId,
@@ -148,11 +150,6 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
148
150
  currentWallet: primaryWallet !== null && primaryWallet !== void 0 ? primaryWallet : connectedWallet,
149
151
  });
150
152
  const walletForUserFacingContext = authMode === 'connect-and-sign' || user ? primaryWallet : connectedWallet;
151
- useSyncPrimaryWallet({
152
- multiWalletWidgetState,
153
- primaryWallet,
154
- setMultiWalletWidgetState,
155
- });
156
153
  const { clearAllWalletConnectSessions, clearOphanedWalletConnectSessions } = useClearWalletConnectSessions({
157
154
  connectors: walletConnectors,
158
155
  });
@@ -196,6 +193,17 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
196
193
  environmentId,
197
194
  walletConnectors,
198
195
  ]);
196
+ useSyncPrimaryWallet({
197
+ computeConnectedStateForWallets,
198
+ handleLogOut,
199
+ multiWalletWidgetState,
200
+ primaryWallet,
201
+ secondaryWallets,
202
+ setMultiWalletWidgetState,
203
+ setPrimaryWallet,
204
+ setShowWidgetStatePopup,
205
+ showWidgetStatePopup,
206
+ });
199
207
  const handleUnlinkWallet = useHandleUnlinkWallet({
200
208
  environmentId,
201
209
  primaryWalletId,
@@ -346,11 +354,13 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
346
354
  setShowAuthFlow,
347
355
  setShowDynamicUserProfile,
348
356
  setShowQrcodeModal,
357
+ setShowWidgetStatePopup,
349
358
  setUser,
350
359
  shadowDOMEnabled,
351
360
  showAuthFlow,
352
361
  showDynamicUserProfile,
353
362
  showQrcodeModal,
363
+ showWidgetStatePopup,
354
364
  signWithEmailWalletName,
355
365
  siweStatement,
356
366
  socialMediaIconUrl: ((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _a === void 0 ? void 0 : _a.supportUrls) || socialMediaIconUrl,
@@ -433,6 +443,7 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
433
443
  showAuthFlow,
434
444
  showDynamicUserProfile,
435
445
  showQrcodeModal,
446
+ showWidgetStatePopup,
436
447
  signWithEmailWalletName,
437
448
  siweStatement,
438
449
  socialMediaIconUrl,
@@ -466,8 +477,9 @@ const DynamicContextProvider = ({ settings: { accessDeniedMessagePrimary, access
466
477
  // DYN-1140 - Opens Widget when multiWalletWidgetState changes
467
478
  useEffect(() => {
468
479
  // If statement to secure SingleWallet widget
469
- if (!multiWallet)
480
+ if (!multiWallet && multiWalletWidgetState !== 'awaiting_account_switch') {
470
481
  return;
482
+ }
471
483
  // We need to make sure that the user is logged in so that we do not try to display the widget before authorization
472
484
  if (user && multiWalletWidgetState !== 'idle' && !showDynamicUserProfile) {
473
485
  setShowDynamicUserProfile(true);
@@ -82,6 +82,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
82
82
  yield verifyWallet({
83
83
  oauth: {
84
84
  accessToken: session.accessToken,
85
+ didToken: session.didToken,
85
86
  provider: providerFromParams,
86
87
  },
87
88
  publicWalletAddress: address,
@@ -78,6 +78,7 @@ const SocialRedirectContextProvider = ({ children, }) => {
78
78
  yield verifyWallet({
79
79
  oauth: {
80
80
  accessToken: session.accessToken,
81
+ didToken: session.didToken,
81
82
  provider: providerFromParams,
82
83
  },
83
84
  publicWalletAddress: address,
@@ -6,7 +6,6 @@ var jsxRuntime = require('react/jsx-runtime');
6
6
  var React = require('react');
7
7
  var ethers = require('ethers');
8
8
  var utils = require('@dynamic-labs/utils');
9
- var Typography = require('../../components/Typography/Typography.cjs');
10
9
  require('@dynamic-labs/sdk-api');
11
10
  require('../../shared/logger.cjs');
12
11
  var getChainIcon = require('../../shared/utils/functions/chain/getChainIcon.cjs');
@@ -17,8 +16,6 @@ var formatBigNumber = require('../../shared/utils/functions/formatBigNumber/form
17
16
  var usePreventPageScroll = require('../../shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.cjs');
18
17
  require('@dynamic-labs/iconic');
19
18
  require('../../context/ViewContext/ViewContext.cjs');
20
- var close = require('../../shared/assets/close.cjs');
21
- var signCircle = require('../../shared/assets/sign-circle.cjs');
22
19
  var index = require('../../shared/consts/index.cjs');
23
20
  var useInternalDynamicContext = require('../../context/DynamicContext/useInternalDynamicContext.cjs');
24
21
  require('@dynamic-labs/multi-wallet');
@@ -38,22 +35,17 @@ require('../../context/CaptchaContext/CaptchaContext.cjs');
38
35
  var usePromise = require('../../utils/hooks/usePromise/usePromise.cjs');
39
36
  var useMutation = require('../../utils/hooks/useMutation/useMutation.cjs');
40
37
  require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
41
- var Button = require('../../components/Button/Button.cjs');
42
- var IconButton = require('../../components/IconButton/IconButton.cjs');
43
- var ModalHeader = require('../../components/ModalHeader/ModalHeader.cjs');
44
- var Alert = require('../../components/Alert/Alert.cjs');
45
- var PoweredByDynamic = require('../../components/PoweredByDynamic/PoweredByDynamic.cjs');
46
- var IconWithSpinner = require('../../components/IconWithSpinner/IconWithSpinner.cjs');
47
- var AppOriginTile = require('../../components/AppOriginTile/AppOriginTile.cjs');
48
- var AnimatePresence = require('../../components/AnimatePresence/AnimatePresence.cjs');
38
+ require('../../components/IconButton/IconButton.cjs');
39
+ require('../../components/Alert/Alert.cjs');
49
40
  require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
50
41
  require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
51
42
  require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
52
- var VerticalDrawerTransition = require('../../components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs');
53
43
  require('../../components/Popper/Popper/Popper.cjs');
54
44
  require('../../components/Popper/PopperContext/PopperContext.cjs');
45
+ var TransactionConfirmationPageLayout = require('../../components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs');
46
+ var TransactionRow = require('../../components/TransactionConfirmationPageLayout/components/TransactionRow/TransactionRow.cjs');
55
47
 
56
- const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onTransactionResponseSuccess, appLogoUrl, appName, transaction, buttonText = 'Send', provider, }) => {
48
+ const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onTransactionResponseSuccess, appLogoUrl, appName, transaction, provider, }) => {
57
49
  usePreventPageScroll.usePreventPageScroll(true);
58
50
  const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
59
51
  const didConfirmRef = React.useRef(false);
@@ -100,19 +92,20 @@ const TransactionConfirmationModal = ({ title, appOrigin, handler, onReject, onT
100
92
  onTransactionResponseSuccess,
101
93
  onReject,
102
94
  ]);
103
- const ChainIcon = getChainIcon.getChainIcon('evm');
104
- const closeButton = (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: handleOnReject, "data-testid": 'close', disabled: isLoading }, { children: jsxRuntime.jsx(close.ReactComponent, {}) })));
95
+ const ChainIconComponent = getChainIcon.getChainIcon('evm');
96
+ const chainIcon = (jsxRuntime.jsx(Icon.Icon, Object.assign({ size: 'small' }, { children: jsxRuntime.jsx(ChainIconComponent, {}) })));
97
+ const errorMessage = transactionError && transactionErrorMessage.transactionErrorMessage(transactionError);
98
+ const warningMessage = React.useMemo(() => {
99
+ const showInsufficientFundsWarningMessage = hasInsufficientFunds && missingFunds;
100
+ if (!showInsufficientFundsWarningMessage)
101
+ return;
102
+ const amountLeft = formatBigNumber.formatBigNumber(missingFunds, 5);
103
+ return `Insufficient funds due to gas price increase from estimate. Please add ${amountLeft} ${currencySymbol} to continue.`;
104
+ }, [currencySymbol, hasInsufficientFunds, missingFunds]);
105
105
  return (jsxRuntime.jsx(Portal.Portal, Object.assign({ handleClose: handleOnReject, isShown: show, zIndex: index.authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
106
106
  onUnmount: handleOnModalUnmount,
107
- } }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation' }, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ trailing: closeButton, alignContent: 'bottom' }, { children: jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: (props) => (jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'brand-primary' }, { children: jsxRuntime.jsx(signCircle.ReactComponent, Object.assign({}, props)) }))), iconSize: 64, isSpinning: true }) })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__body' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'title', color: 'primary', className: 'transaction-confirmation__title' }, { children: title })), jsxRuntime.jsx(AnimatePresence.AnimatePresence, Object.assign({ animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}) }, { children: transactionError && (jsxRuntime.jsx("div", Object.assign({ className: 'transaction-confirmation__error' }, { children: jsxRuntime.jsx(Alert.Alert, Object.assign({ icon: 'error', variant: 'error' }, { children: transactionErrorMessage.transactionErrorMessage(transactionError) })) }))) })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__content' }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'transaction-confirmation__app-origin-tile' }, { children: jsxRuntime.jsx(AppOriginTile.AppOriginTile, { appLogoUrl: appLogoUrl, appName: appName, appOrigin: appOrigin }) })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-info' }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-row' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-confirmation__transaction-row__title' }, { children: "From (You)" })), isTransactionFromAddressLoading && jsxRuntime.jsx(CoinCell, { children: "--" }), !isTransactionFromAddressLoading &&
108
- transactionFromAddress && (jsxRuntime.jsx(CoinCell, { children: shortenWalletAddress.shortenWalletAddress(transactionFromAddress, 4, 4) })), !isTransactionFromAddressLoading &&
109
- !transactionFromAddress && (jsxRuntime.jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" })))] })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-row' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-confirmation__transaction-row__title' }, { children: "To" })), isTransactionToAddressLoading && jsxRuntime.jsx(CoinCell, { children: "--" }), !isTransactionToAddressLoading && !transactionToAddress && (jsxRuntime.jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" }))), !isTransactionToAddressLoading && transactionToAddress && (jsxRuntime.jsx(CoinCell, { children: shortenWalletAddress.shortenWalletAddress(transactionToAddress, 4, 4) }))] })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-row' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-confirmation__transaction-row__title' }, { children: "Amount" })), isEffectiveValueLoading && (jsxRuntime.jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsxRuntime.jsx(ChainIcon, {}) }, { children: "--" }))), !isEffectiveValueLoading && transactionValue && (jsxRuntime.jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsxRuntime.jsx(ChainIcon, {}), dataTestId: 'transaction-amount', title: formatBigNumber.formatBigNumber(transactionValue) }, { children: formatBigNumber.formatBigNumber(transactionValue, 10) }))), !isEffectiveValueLoading && !transactionValue && (jsxRuntime.jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular', symbol: currencySymbol, icon: jsxRuntime.jsx(ChainIcon, {}) }, { children: "0" })))] })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-row' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-confirmation__transaction-row__title' }, { children: "Gas (estimated)" })), isGasPriceLoading && jsxRuntime.jsx(CoinCell, { children: "--" }), !isGasPriceLoading && !gasEstimate && (jsxRuntime.jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" }))), !isGasPriceLoading && gasEstimate && (jsxRuntime.jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsxRuntime.jsx(ChainIcon, {}), dataTestId: 'transaction-gas-free', title: formatBigNumber.formatBigNumber(gasEstimate) }, { children: formatBigNumber.formatBigNumber(gasEstimate, 10) })))] })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__transaction-row' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ color: 'secondary', variant: 'body_normal', weight: 'regular', className: 'transaction-confirmation__transaction-row__title' }, { children: "Total" })), total && (jsxRuntime.jsx(CoinCell, Object.assign({ symbol: currencySymbol, icon: jsxRuntime.jsx(ChainIcon, {}), dataTestId: 'transaction-total', title: formatBigNumber.formatBigNumber(total) }, { children: formatBigNumber.formatBigNumber(total, 10) }))), !total && (jsxRuntime.jsx(CoinCell, Object.assign({ color: 'secondary', weight: 'regular' }, { children: "N/A" })))] }))] }))] })), jsxRuntime.jsx(AnimatePresence.AnimatePresence, Object.assign({ animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}) }, { children: hasInsufficientFunds && missingFunds && (jsxRuntime.jsx("div", Object.assign({ className: 'transaction-confirmation__warning' }, { children: jsxRuntime.jsxs(Alert.Alert, Object.assign({ icon: 'error', variant: 'warning', contentDataTestId: 'warning_content' }, { children: ["Insufficient funds due to gas price increase from estimate. Please add ", formatBigNumber.formatBigNumber(missingFunds, 5), ' ', currencySymbol, " to continue."] })) }))) })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-confirmation__actions' }, { children: [jsxRuntime.jsx(Button.Button, Object.assign({ buttonVariant: 'secondary', onClick: handleOnReject, expanded: true, buttonPadding: 'large', buttonRounded: 'default', disabled: isLoading }, { children: "Cancel" })), jsxRuntime.jsx(Button.Button, Object.assign({ buttonVariant: 'primary', buttonPadding: 'large', onClick: () => sendTransaction(), expanded: true, buttonRounded: 'default', loading: isLoading, disabled: isLoadingTransaction || hasInsufficientFunds }, { children: buttonText }))] })), jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {})] }))] })) })));
110
- };
111
- const CoinCell = ({ children, symbol, icon, color = 'primary', weight = 'medium', dataTestId, title, }) => (jsxRuntime.jsxs("div", Object.assign({ "data-testid": dataTestId, style: {
112
- alignItems: 'center',
113
- display: 'flex',
114
- gap: '0.25rem',
115
- minWidth: 0,
116
- } }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ title: title, color: color, variant: 'body_normal', weight: weight, truncate: true }, { children: children })), symbol && (jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', color: 'secondary', weight: 'regular' }, { children: symbol }))), icon && jsxRuntime.jsx(Icon.Icon, Object.assign({ size: 'small' }, { children: icon }))] })));
107
+ } }, { children: jsxRuntime.jsx("div", Object.assign({ className: 'transaction-confirmation' }, { children: jsxRuntime.jsxs(TransactionConfirmationPageLayout.TransactionConfirmationPageLayout, Object.assign({ appOrigin: appOrigin, appLogoUrl: appLogoUrl, appName: appName, isLoading: isLoading, disableSendButton: isLoadingTransaction || hasInsufficientFunds, onClickSend: () => sendTransaction(), onClickClose: handleOnReject, displayPoweredByDynamicFooter: true, error: errorMessage, warningMessage: warningMessage, title: title }, { children: [jsxRuntime.jsx(TransactionRow.TransactionRow, Object.assign({ label: 'From (You)', isLoading: isTransactionFromAddressLoading, title: transactionFromAddress }, { children: shortenWalletAddress.shortenWalletAddress(transactionFromAddress, 4, 4) })), jsxRuntime.jsx(TransactionRow.TransactionRow, Object.assign({ label: 'To', isLoading: isTransactionToAddressLoading, title: transactionToAddress }, { children: transactionToAddress &&
108
+ shortenWalletAddress.shortenWalletAddress(transactionToAddress, 4, 4) })), jsxRuntime.jsx(TransactionRow.TransactionRow, Object.assign({ label: 'Amount', isLoading: isEffectiveValueLoading, isEmpty: !transactionValue, title: transactionValue && formatBigNumber.formatBigNumber(transactionValue), suffix: currencySymbol, icon: chainIcon, dataTestId: 'transaction-amount' }, { children: transactionValue ? formatBigNumber.formatBigNumber(transactionValue, 10) : 0 })), jsxRuntime.jsx(TransactionRow.TransactionRow, Object.assign({ label: 'Gas (estimated)', isEmpty: !gasEstimate, isLoading: isGasPriceLoading, title: gasEstimate && formatBigNumber.formatBigNumber(gasEstimate), suffix: gasEstimate && currencySymbol, icon: gasEstimate && chainIcon, dataTestId: 'transaction-gas-free' }, { children: gasEstimate ? formatBigNumber.formatBigNumber(gasEstimate, 10) : 'N/A' })), jsxRuntime.jsx(TransactionRow.TransactionRow, Object.assign({ label: 'Total', isEmpty: !total, title: total && formatBigNumber.formatBigNumber(total), suffix: total && currencySymbol, icon: total && chainIcon, dataTestId: 'transaction-total' }, { children: total ? formatBigNumber.formatBigNumber(total, 10) : 'N/A' }))] })) })) })));
109
+ };
117
110
 
118
111
  exports.TransactionConfirmationModal = TransactionConfirmationModal;