@dynamic-labs/sdk-react-core 0.18.0-beta.32 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +9 -9
  5. package/src/lib/components/Button/Button.cjs +10 -7
  6. package/src/lib/components/Button/Button.js +10 -7
  7. package/src/lib/components/ErrorContainer/ErrorContainer.d.ts +1 -1
  8. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +3 -1
  9. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +3 -1
  10. package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +2 -2
  11. package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +2 -2
  12. package/src/lib/context/DynamicContext/DynamicContext.cjs +7 -2
  13. package/src/lib/context/DynamicContext/DynamicContext.js +8 -3
  14. package/src/lib/context/DynamicContext/hooks/useVerificationInProgress/useVerificationInProgress.cjs +13 -3
  15. package/src/lib/context/DynamicContext/hooks/useVerificationInProgress/useVerificationInProgress.js +13 -3
  16. package/src/lib/context/DynamicContext/types/index.d.ts +2 -2
  17. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +10 -2
  18. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +10 -2
  19. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.types.d.ts +2 -0
  20. package/src/lib/styles/index.shadow.cjs +1 -1
  21. package/src/lib/styles/index.shadow.js +1 -1
  22. package/src/lib/utils/constants/errors.cjs +7 -0
  23. package/src/lib/utils/constants/errors.d.ts +1 -0
  24. package/src/lib/utils/constants/errors.js +3 -0
  25. package/src/lib/utils/constants/index.d.ts +1 -1
  26. package/src/lib/utils/constants/localStorage.cjs +3 -1
  27. package/src/lib/utils/constants/localStorage.d.ts +1 -0
  28. package/src/lib/utils/constants/localStorage.js +3 -2
  29. package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.cjs +14 -2
  30. package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.d.ts +3 -2
  31. package/src/lib/utils/functions/getUserProfileFields/getUserProfileFields.js +14 -2
  32. package/src/lib/utils/functions/index.d.ts +1 -0
  33. package/src/lib/utils/functions/isMagicConnector/index.d.ts +1 -0
  34. package/src/lib/utils/functions/isMagicConnector/isMagicConnector.cjs +10 -0
  35. package/src/lib/utils/functions/isMagicConnector/isMagicConnector.d.ts +2 -0
  36. package/src/lib/utils/functions/isMagicConnector/isMagicConnector.js +6 -0
  37. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +2 -2
  38. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.d.ts +2 -1
  39. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +2 -2
  40. package/src/lib/utils/hooks/index.d.ts +2 -0
  41. package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.cjs +19 -3
  42. package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.d.ts +1 -2
  43. package/src/lib/utils/hooks/multiWallet/useMultiWallet/useMultiWallet.js +20 -4
  44. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +11 -9
  45. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.d.ts +1 -1
  46. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +11 -9
  47. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +1 -1
  48. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +1 -1
  49. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +2 -2
  50. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +1 -1
  51. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +2 -2
  52. package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.cjs +2 -7
  53. package/src/lib/utils/hooks/useFetchNetworkConfigurations/useFetchNetworkConfigurations.js +2 -7
  54. package/src/lib/utils/hooks/useFetchNetworkConfigurations/utils/index.d.ts +1 -0
  55. package/src/lib/utils/hooks/useFetchNetworkConfigurations/utils/mergeCustomerEvmNetworksWithServerNetworks/index.d.ts +1 -0
  56. package/src/lib/utils/hooks/useFetchNetworkConfigurations/utils/mergeCustomerEvmNetworksWithServerNetworks/mergeCustomerEvmNetworksWithServerNetworks.cjs +16 -0
  57. package/src/lib/utils/hooks/useFetchNetworkConfigurations/utils/mergeCustomerEvmNetworksWithServerNetworks/mergeCustomerEvmNetworksWithServerNetworks.d.ts +2 -0
  58. package/src/lib/utils/hooks/useFetchNetworkConfigurations/utils/mergeCustomerEvmNetworksWithServerNetworks/mergeCustomerEvmNetworksWithServerNetworks.js +12 -0
  59. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +22 -4
  60. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +22 -4
  61. package/src/lib/utils/hooks/useTransactionEstimatedGas/index.d.ts +1 -0
  62. package/src/lib/utils/hooks/useTransactionEstimatedGas/useTransactionEstimatedGas.cjs +61 -0
  63. package/src/lib/utils/hooks/useTransactionEstimatedGas/useTransactionEstimatedGas.d.ts +20 -0
  64. package/src/lib/utils/hooks/useTransactionEstimatedGas/useTransactionEstimatedGas.js +57 -0
  65. package/src/lib/utils/hooks/useTransactionWithGasPrice/index.d.ts +1 -0
  66. package/src/lib/utils/hooks/useTransactionWithGasPrice/useTransactionWithGasPrice.cjs +47 -0
  67. package/src/lib/utils/hooks/useTransactionWithGasPrice/useTransactionWithGasPrice.d.ts +32 -0
  68. package/src/lib/utils/hooks/useTransactionWithGasPrice/useTransactionWithGasPrice.js +43 -0
  69. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -0
  70. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -0
  71. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +1 -1
  72. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +2 -2
  73. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.d.ts +5 -1
  74. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +2 -2
  75. package/src/lib/utils/hooks/useWallets/useWallets.d.ts +2 -2
  76. package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +4 -0
  77. package/src/lib/views/CollectUserDataView/UserDataFields/index.js +4 -0
  78. package/src/lib/views/EmailUpdate/EmailUpdate.cjs +5 -2
  79. package/src/lib/views/EmailUpdate/EmailUpdate.js +5 -2
  80. package/src/lib/views/EmailVerification/EmailVerification.cjs +6 -1
  81. package/src/lib/views/EmailVerification/EmailVerification.js +7 -2
  82. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailWalletList/LoginWithEmailWalletList.cjs +4 -1
  83. package/src/lib/views/LoginWithEmailView/components/LoginWithEmailWalletList/LoginWithEmailWalletList.js +4 -1
  84. package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +4 -0
  85. package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +4 -0
  86. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +1 -0
  87. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +1 -0
  88. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +1 -0
  89. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +1 -0
  90. package/src/lib/views/SendBalanceView/SendBalanceView.cjs +11 -16
  91. package/src/lib/views/SendBalanceView/SendBalanceView.js +11 -16
  92. package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.cjs +66 -0
  93. package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.d.ts +8 -0
  94. package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.js +62 -0
  95. package/src/lib/views/SendBalanceView/components/TransactionStage/index.d.ts +1 -0
  96. package/src/lib/views/SendBalanceView/components/index.d.ts +1 -0
  97. package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +1 -2
  98. package/src/lib/views/SocialRedirectView/SocialRedirectView.js +1 -2
  99. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +22 -4
  100. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +22 -4
  101. package/src/lib/views/TransactionConfirmationView/hooks/index.d.ts +2 -1
  102. package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/index.d.ts +1 -0
  103. package/src/lib/views/TransactionConfirmationView/hooks/{useTransactionData/useTransactionData.cjs → useTransactionGas/useTransactionGas.cjs} +17 -42
  104. package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.d.ts +11 -0
  105. package/src/lib/views/TransactionConfirmationView/hooks/{useTransactionData/useTransactionData.js → useTransactionGas/useTransactionGas.js} +18 -43
  106. package/src/lib/views/TransactionConfirmationView/hooks/useTransactionTotal/index.d.ts +1 -0
  107. package/src/lib/views/TransactionConfirmationView/hooks/useTransactionTotal/useTransactionTotal.cjs +14 -0
  108. package/src/lib/views/TransactionConfirmationView/hooks/useTransactionTotal/useTransactionTotal.d.ts +7 -0
  109. package/src/lib/views/TransactionConfirmationView/hooks/useTransactionTotal/useTransactionTotal.js +10 -0
  110. package/src/lib/views/WalletList/WalletList.cjs +4 -1
  111. package/src/lib/views/WalletList/WalletList.js +4 -1
  112. package/src/lib/views/WalletLockedView/WalletLockedView.cjs +20 -4
  113. package/src/lib/views/WalletLockedView/WalletLockedView.js +20 -4
  114. package/src/lib/views/TransactionConfirmationView/hooks/useTransactionData/index.d.ts +0 -1
  115. package/src/lib/views/TransactionConfirmationView/hooks/useTransactionData/useTransactionData.d.ts +0 -18
package/CHANGELOG.md CHANGED
@@ -1,4 +1,28 @@
1
1
 
2
+ ## [0.18.0](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-beta.32...v0.18.0) (2023-08-13)
3
+
4
+
5
+ ### Features
6
+
7
+ * add in OKX wallet integration ([#2871](https://github.com/dynamic-labs/DynamicAuth/issues/2871)) ([#2927](https://github.com/dynamic-labs/DynamicAuth/issues/2927)) ([f6d06bc](https://github.com/dynamic-labs/DynamicAuth/commit/f6d06bc75ee0e53c9d972f5fab1f4de11818bd82))
8
+ * update wallet locked view ([#2923](https://github.com/dynamic-labs/DynamicAuth/issues/2923)) ([3cc03ee](https://github.com/dynamic-labs/DynamicAuth/commit/3cc03ee5913434d99386fc89d4d26d5d3fb3ca19))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * account already exist message not displaying automatically ([#2896](https://github.com/dynamic-labs/DynamicAuth/issues/2896)) ([#2906](https://github.com/dynamic-labs/DynamicAuth/issues/2906)) ([5e7478a](https://github.com/dynamic-labs/DynamicAuth/commit/5e7478acd864451a7cf7e8e62845cca7ef5439c6))
14
+ * don't let user update email if it's tied to an embedded wallet ([#2903](https://github.com/dynamic-labs/DynamicAuth/issues/2903)) ([33c52b5](https://github.com/dynamic-labs/DynamicAuth/commit/33c52b50a880a34b4161a700b8b1805c9b01527d)), closes [#2883](https://github.com/dynamic-labs/DynamicAuth/issues/2883)
15
+ * **GVTY-195:** issues with mergeUserAccountsView ([#2945](https://github.com/dynamic-labs/DynamicAuth/issues/2945)) ([2c6265e](https://github.com/dynamic-labs/DynamicAuth/commit/2c6265e3e709edb9ff1af6e6c139b85418e46d76))
16
+ * **Magic:** improve gas estimate for transactions ([#2947](https://github.com/dynamic-labs/DynamicAuth/issues/2947)) ([ad35a72](https://github.com/dynamic-labs/DynamicAuth/commit/ad35a722df6abd54b98ea491661ff4ec3e602621))
17
+ * missing enable isVerificationInProgress ([#2926](https://github.com/dynamic-labs/DynamicAuth/issues/2926)) ([98f54fd](https://github.com/dynamic-labs/DynamicAuth/commit/98f54fd1345713dfaf0ef837502dfaca3709d633))
18
+ * **networks:** merge custom network after API networks ([#2949](https://github.com/dynamic-labs/DynamicAuth/issues/2949)) ([ab22303](https://github.com/dynamic-labs/DynamicAuth/commit/ab22303294123c2a914a65f0d2c15481740647bb))
19
+ * onBeforeConnectSuccessConfirmation is being called multiple time ([#2965](https://github.com/dynamic-labs/DynamicAuth/issues/2965)) ([a276968](https://github.com/dynamic-labs/DynamicAuth/commit/a2769689bc82350dfb8123e1fe8a4e92a60b262c))
20
+ * **QNTM-249:** broken email update when user is authenticated ([#2932](https://github.com/dynamic-labs/DynamicAuth/issues/2932)) ([db33ba1](https://github.com/dynamic-labs/DynamicAuth/commit/db33ba14c317469958ce314a3822b706e20b07d0))
21
+ * reformat social sign-in text ([#2956](https://github.com/dynamic-labs/DynamicAuth/issues/2956)) ([#2961](https://github.com/dynamic-labs/DynamicAuth/issues/2961)) ([f8d2222](https://github.com/dynamic-labs/DynamicAuth/commit/f8d2222d102f5335f95ec917cbb63bf9b55eff0b))
22
+ * **transaction:** improve gas estimate in transaction confirmation ([#2938](https://github.com/dynamic-labs/DynamicAuth/issues/2938)) ([02d0f46](https://github.com/dynamic-labs/DynamicAuth/commit/02d0f46127e94e83b4decbaaf6a45dbae135c89d))
23
+ * useSyncPrimaryWallet overrides views with "wallet-locked-view" ([#2921](https://github.com/dynamic-labs/DynamicAuth/issues/2921)) ([aa8c369](https://github.com/dynamic-labs/DynamicAuth/commit/aa8c369d2a713eb57ecc99b16a6b62d465789370))
24
+ * **wallet-list:** update key to distinguish wallet and wallet group ([#2922](https://github.com/dynamic-labs/DynamicAuth/issues/2922)) ([f40c07c](https://github.com/dynamic-labs/DynamicAuth/commit/f40c07c65915775e99a1dbb8d07bb23824a92915)), closes [#2909](https://github.com/dynamic-labs/DynamicAuth/issues/2909)
25
+
2
26
  ## [0.18.0-beta.32](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-beta.31...v0.18.0-beta.32) (2023-08-09)
3
27
 
4
28
 
package/package.cjs CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "0.18.0-beta.32";
5
+ var version = "0.18.0";
6
6
  var dependencies = {
7
7
  "react-focus-lock": "2.9.2",
8
8
  "@dynamic-labs/iconic": "0.1.23",
9
- "@dynamic-labs/sdk-api": "0.0.255",
9
+ "@dynamic-labs/sdk-api": "0.0.256",
10
10
  "@hcaptcha/react-hcaptcha": "1.4.4",
11
11
  "country-list": "2.3.0",
12
12
  yup: "0.32.11",
package/package.js CHANGED
@@ -1,8 +1,8 @@
1
- var version = "0.18.0-beta.32";
1
+ var version = "0.18.0";
2
2
  var dependencies = {
3
3
  "react-focus-lock": "2.9.2",
4
4
  "@dynamic-labs/iconic": "0.1.23",
5
- "@dynamic-labs/sdk-api": "0.0.255",
5
+ "@dynamic-labs/sdk-api": "0.0.256",
6
6
  "@hcaptcha/react-hcaptcha": "1.4.4",
7
7
  "country-list": "2.3.0",
8
8
  yup: "0.32.11",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "0.18.0-beta.32",
3
+ "version": "0.18.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -9,20 +9,20 @@
9
9
  "dependencies": {
10
10
  "react-focus-lock": "2.9.2",
11
11
  "@dynamic-labs/iconic": "0.1.23",
12
- "@dynamic-labs/sdk-api": "0.0.255",
12
+ "@dynamic-labs/sdk-api": "0.0.256",
13
13
  "@hcaptcha/react-hcaptcha": "1.4.4",
14
14
  "country-list": "2.3.0",
15
15
  "yup": "0.32.11",
16
16
  "formik": "2.2.9",
17
17
  "qrcode": "1.5.1",
18
18
  "ethers": "5.7.2",
19
- "@dynamic-labs/logger": "0.18.0-beta.32",
20
- "@dynamic-labs/multi-wallet": "0.18.0-beta.32",
21
- "@dynamic-labs/rpc-providers": "0.18.0-beta.32",
22
- "@dynamic-labs/types": "0.18.0-beta.32",
23
- "@dynamic-labs/utils": "0.18.0-beta.32",
24
- "@dynamic-labs/wallet-book": "0.18.0-beta.32",
25
- "@dynamic-labs/wallet-connector-core": "0.18.0-beta.32",
19
+ "@dynamic-labs/logger": "0.18.0",
20
+ "@dynamic-labs/multi-wallet": "0.18.0",
21
+ "@dynamic-labs/rpc-providers": "0.18.0",
22
+ "@dynamic-labs/types": "0.18.0",
23
+ "@dynamic-labs/utils": "0.18.0",
24
+ "@dynamic-labs/wallet-book": "0.18.0",
25
+ "@dynamic-labs/wallet-connector-core": "0.18.0",
26
26
  "eventemitter3": "5.0.1"
27
27
  },
28
28
  "devDependencies": {
@@ -36,12 +36,15 @@ const Button = ({ buttonClassName = '', buttonPadding = 'medium', buttonVariant
36
36
  }, buttonPadding ? buttonPaddingClassNameMap[buttonPadding] : '', buttonVariant ? buttonVariantClassNameMap[buttonVariant] : '', buttonRounded ? buttonRoundedClassNameMap[buttonRounded] : '', buttonClassName);
37
37
  const handleClick = (e) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
38
38
  if (onClick) {
39
- setInternalButtonLoading(true);
40
- try {
41
- yield onClick(e);
42
- }
43
- finally {
44
- setInternalButtonLoading(false);
39
+ const onClickResult = onClick(e);
40
+ if (onClickResult instanceof Promise) {
41
+ setInternalButtonLoading(true);
42
+ try {
43
+ yield onClickResult;
44
+ }
45
+ finally {
46
+ setInternalButtonLoading(false);
47
+ }
45
48
  }
46
49
  }
47
50
  if (feedback) {
@@ -52,7 +55,7 @@ const Button = ({ buttonClassName = '', buttonPadding = 'medium', buttonVariant
52
55
  }
53
56
  });
54
57
  const buttonContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [startSlot && jsxRuntime.jsx("div", Object.assign({ className: 'button__start-slot' }, { children: startSlot })), (feedback || children) && (jsxRuntime.jsx(Typography.Typography, Object.assign({ variant: 'button_primary', color: 'primary', as: 'span' }, typographyProps, { children: isFeedbackVisible && feedback ? feedback : children }))), endSlot && jsxRuntime.jsx("div", Object.assign({ className: 'button__end-slot' }, { children: endSlot }))] }));
55
- return (jsxRuntime.jsxs("button", Object.assign({ type: type, onClick: handleClick, className: buttonEffectiveClassName, disabled: disabled || internalButtonLoading || loading, "data-testid": dataTestId }, { children: [(internalButtonLoading || loading) && (jsxRuntime.jsx("div", Object.assign({ className: 'button__spinner-container' }, { children: jsxRuntime.jsx(spinner.Spinner, { className: 'button__spinner' }) }))), buttonContent] })));
58
+ return (jsxRuntime.jsxs("button", Object.assign({ type: type, onClick: handleClick, className: buttonEffectiveClassName, disabled: disabled || internalButtonLoading || loading, "data-testid": dataTestId }, { children: [(internalButtonLoading || loading) && (jsxRuntime.jsx("div", Object.assign({ className: 'button__spinner-container', "data-testid": 'button__spinner' }, { children: jsxRuntime.jsx(spinner.Spinner, { className: 'button__spinner' }) }))), buttonContent] })));
56
59
  };
57
60
 
58
61
  exports.Button = Button;
@@ -32,12 +32,15 @@ const Button = ({ buttonClassName = '', buttonPadding = 'medium', buttonVariant
32
32
  }, buttonPadding ? buttonPaddingClassNameMap[buttonPadding] : '', buttonVariant ? buttonVariantClassNameMap[buttonVariant] : '', buttonRounded ? buttonRoundedClassNameMap[buttonRounded] : '', buttonClassName);
33
33
  const handleClick = (e) => __awaiter(void 0, void 0, void 0, function* () {
34
34
  if (onClick) {
35
- setInternalButtonLoading(true);
36
- try {
37
- yield onClick(e);
38
- }
39
- finally {
40
- setInternalButtonLoading(false);
35
+ const onClickResult = onClick(e);
36
+ if (onClickResult instanceof Promise) {
37
+ setInternalButtonLoading(true);
38
+ try {
39
+ yield onClickResult;
40
+ }
41
+ finally {
42
+ setInternalButtonLoading(false);
43
+ }
41
44
  }
42
45
  }
43
46
  if (feedback) {
@@ -48,7 +51,7 @@ const Button = ({ buttonClassName = '', buttonPadding = 'medium', buttonVariant
48
51
  }
49
52
  });
50
53
  const buttonContent = (jsxs(Fragment, { children: [startSlot && jsx("div", Object.assign({ className: 'button__start-slot' }, { children: startSlot })), (feedback || children) && (jsx(Typography, Object.assign({ variant: 'button_primary', color: 'primary', as: 'span' }, typographyProps, { children: isFeedbackVisible && feedback ? feedback : children }))), endSlot && jsx("div", Object.assign({ className: 'button__end-slot' }, { children: endSlot }))] }));
51
- return (jsxs("button", Object.assign({ type: type, onClick: handleClick, className: buttonEffectiveClassName, disabled: disabled || internalButtonLoading || loading, "data-testid": dataTestId }, { children: [(internalButtonLoading || loading) && (jsx("div", Object.assign({ className: 'button__spinner-container' }, { children: jsx(Spinner, { className: 'button__spinner' }) }))), buttonContent] })));
54
+ return (jsxs("button", Object.assign({ type: type, onClick: handleClick, className: buttonEffectiveClassName, disabled: disabled || internalButtonLoading || loading, "data-testid": dataTestId }, { children: [(internalButtonLoading || loading) && (jsx("div", Object.assign({ className: 'button__spinner-container', "data-testid": 'button__spinner' }, { children: jsx(Spinner, { className: 'button__spinner' }) }))), buttonContent] })));
52
55
  };
53
56
 
54
57
  export { Button };
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- type Variant = 'error' | 'info';
2
+ type Variant = 'error' | 'info' | 'success';
3
3
  type Props = {
4
4
  children: ReactNode;
5
5
  className?: string;
@@ -36,7 +36,9 @@ var PoweredByDynamic = require('../PoweredByDynamic/PoweredByDynamic.cjs');
36
36
  const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBack, title, error, appOrigin, appLogoUrl, appName, onClickSend, disableSendButton, displayPoweredByDynamicFooter = false, warningMessage, children, }) => {
37
37
  const closeButton = onClickClose && (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: onClickClose, "data-testid": 'close', disabled: isLoading }, { children: jsxRuntime.jsx(close.ReactComponent, {}) })));
38
38
  const backButton = onClickBack && (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: onClickBack, "data-testid": 'back-button' }, { children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) })));
39
- 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(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'transaction-confirmation__footer' }))] }))] }));
39
+ 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: (event) => {
40
+ onClickSend === null || onClickSend === void 0 ? void 0 : onClickSend(event);
41
+ }, expanded: true, buttonRounded: 'default', loading: isLoading, disabled: disableSendButton }, { children: "Send" }))] })), displayPoweredByDynamicFooter && (jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'transaction-confirmation__footer' }))] }))] }));
40
42
  };
41
43
 
42
44
  exports.TransactionConfirmationPageLayout = TransactionConfirmationPageLayout;
@@ -32,7 +32,9 @@ import { PoweredByDynamic } from '../PoweredByDynamic/PoweredByDynamic.js';
32
32
  const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBack, title, error, appOrigin, appLogoUrl, appName, onClickSend, disableSendButton, displayPoweredByDynamicFooter = false, warningMessage, children, }) => {
33
33
  const closeButton = onClickClose && (jsx(IconButton, Object.assign({ type: 'button', onClick: onClickClose, "data-testid": 'close', disabled: isLoading }, { children: jsx(SvgClose, {}) })));
34
34
  const backButton = onClickBack && (jsx(IconButton, Object.assign({ type: 'button', onClick: onClickBack, "data-testid": 'back-button' }, { children: jsx(SvgChevronLeft, {}) })));
35
- 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(PoweredByDynamic, { classNameRoot: 'transaction-confirmation__footer' }))] }))] }));
35
+ 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: (event) => {
36
+ onClickSend === null || onClickSend === void 0 ? void 0 : onClickSend(event);
37
+ }, expanded: true, buttonRounded: 'default', loading: isLoading, disabled: disableSendButton }, { children: "Send" }))] })), displayPoweredByDynamicFooter && (jsx(PoweredByDynamic, { classNameRoot: 'transaction-confirmation__footer' }))] }))] }));
36
38
  };
37
39
 
38
40
  export { TransactionConfirmationPageLayout };
@@ -54,8 +54,8 @@ var TransactionRow = require('../TransactionConfirmationPageLayout/components/Tr
54
54
 
55
55
  const TransactionStatusLayout = ({ destinationAddress, amount, networkName, networkCurrency, NetworkIcon, onDone, displayPoweredByDynamicFooter = true, onClickClose, }) => {
56
56
  const closeButton = onClickClose && (jsxRuntime.jsx(IconButton.IconButton, Object.assign({ type: 'button', onClick: onClickClose, "data-testid": 'close' }, { children: jsxRuntime.jsx(close.ReactComponent, {}) })));
57
- const networkIcon = (jsxRuntime.jsx("div", Object.assign({ className: 'transaction-status-layout__network-icon' }, { children: NetworkIcon })));
58
- return (jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-status-layout' }, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ trailing: closeButton, alignContent: 'bottom' }, { children: jsxRuntime.jsx(IconWithStatus.IconWithStatus, { containerClassName: 'transaction-status-layout__status-icon', iconSize: 50, Icon: signCircle.ReactComponent, InnerIcon: check.ReactComponent }) })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-status-layout__body' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'transaction-status-layout__title' }, { children: "Transaction successfully sent" })), jsxRuntime.jsx("div", Object.assign({ className: 'transaction-status-layout__content' }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-status-layout__rows' }, { children: [jsxRuntime.jsx(TransactionRow.TransactionRow, Object.assign({ label: 'Recipient' }, { children: shortenWalletAddress.shortenWalletAddress(destinationAddress, 3, 3) })), jsxRuntime.jsxs(TransactionRow.TransactionRow, Object.assign({ label: 'Network' }, { children: [networkIcon, jsxRuntime.jsx("span", Object.assign({ className: 'transaction-status-layout__network-name' }, { children: networkName }))] })), jsxRuntime.jsxs(TransactionRow.TransactionRow, Object.assign({ label: 'Total amount' }, { children: [amount, jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', color: 'secondary', className: 'transaction-status-layout__network-currency' }, { children: networkCurrency }))] }))] })) })), jsxRuntime.jsx("div", Object.assign({ className: 'transaction-status-layout__actions' }, { children: jsxRuntime.jsx(Button.Button, Object.assign({ buttonVariant: 'primary', buttonPadding: 'large', expanded: true, buttonRounded: 'default', onClick: onDone }, { children: "Continue" })) })), displayPoweredByDynamicFooter && (jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'transaction-status-layout__footer' }))] }))] })));
57
+ const networkIcon = (jsxRuntime.jsx("span", Object.assign({ className: 'transaction-status-layout__network-icon' }, { children: NetworkIcon })));
58
+ return (jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-status-layout' }, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, Object.assign({ trailing: closeButton, alignContent: 'bottom' }, { children: jsxRuntime.jsx(IconWithStatus.IconWithStatus, { containerClassName: 'transaction-status-layout__status-icon', iconSize: 50, Icon: signCircle.ReactComponent, InnerIcon: check.ReactComponent }) })), jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-status-layout__body' }, { children: [jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'transaction-status-layout__title' }, { children: "Transaction successfully sent" })), jsxRuntime.jsx("div", Object.assign({ className: 'transaction-status-layout__content' }, { children: jsxRuntime.jsxs("div", Object.assign({ className: 'transaction-status-layout__rows' }, { children: [jsxRuntime.jsx(TransactionRow.TransactionRow, Object.assign({ label: 'Recipient' }, { children: shortenWalletAddress.shortenWalletAddress(destinationAddress, 3, 3) })), jsxRuntime.jsxs(TransactionRow.TransactionRow, Object.assign({ label: 'Network' }, { children: [networkIcon, jsxRuntime.jsx("span", Object.assign({ className: 'transaction-status-layout__network-name' }, { children: networkName }))] })), jsxRuntime.jsxs(TransactionRow.TransactionRow, Object.assign({ label: 'Total amount' }, { children: [amount, jsxRuntime.jsx(Typography.Typography, Object.assign({ as: 'span', color: 'secondary', className: 'transaction-status-layout__network-currency' }, { children: networkCurrency }))] }))] })) })), jsxRuntime.jsx("div", Object.assign({ className: 'transaction-status-layout__actions' }, { children: jsxRuntime.jsx(Button.Button, Object.assign({ buttonVariant: 'primary', buttonPadding: 'large', expanded: true, buttonRounded: 'default', onClick: onDone, loading: false }, { children: "Continue" })) })), displayPoweredByDynamicFooter && (jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'transaction-status-layout__footer' }))] }))] })));
59
59
  };
60
60
 
61
61
  exports.TransactionStatusLayout = TransactionStatusLayout;
@@ -50,8 +50,8 @@ import { TransactionRow } from '../TransactionConfirmationPageLayout/components/
50
50
 
51
51
  const TransactionStatusLayout = ({ destinationAddress, amount, networkName, networkCurrency, NetworkIcon, onDone, displayPoweredByDynamicFooter = true, onClickClose, }) => {
52
52
  const closeButton = onClickClose && (jsx(IconButton, Object.assign({ type: 'button', onClick: onClickClose, "data-testid": 'close' }, { children: jsx(SvgClose, {}) })));
53
- const networkIcon = (jsx("div", Object.assign({ className: 'transaction-status-layout__network-icon' }, { children: NetworkIcon })));
54
- return (jsxs("div", Object.assign({ className: 'transaction-status-layout' }, { children: [jsx(ModalHeader, Object.assign({ trailing: closeButton, alignContent: 'bottom' }, { children: jsx(IconWithStatus, { containerClassName: 'transaction-status-layout__status-icon', iconSize: 50, Icon: SvgSignCircle, InnerIcon: SvgCheck }) })), jsxs("div", Object.assign({ className: 'transaction-status-layout__body' }, { children: [jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'transaction-status-layout__title' }, { children: "Transaction successfully sent" })), jsx("div", Object.assign({ className: 'transaction-status-layout__content' }, { children: jsxs("div", Object.assign({ className: 'transaction-status-layout__rows' }, { children: [jsx(TransactionRow, Object.assign({ label: 'Recipient' }, { children: shortenWalletAddress(destinationAddress, 3, 3) })), jsxs(TransactionRow, Object.assign({ label: 'Network' }, { children: [networkIcon, jsx("span", Object.assign({ className: 'transaction-status-layout__network-name' }, { children: networkName }))] })), jsxs(TransactionRow, Object.assign({ label: 'Total amount' }, { children: [amount, jsx(Typography, Object.assign({ as: 'span', color: 'secondary', className: 'transaction-status-layout__network-currency' }, { children: networkCurrency }))] }))] })) })), jsx("div", Object.assign({ className: 'transaction-status-layout__actions' }, { children: jsx(Button, Object.assign({ buttonVariant: 'primary', buttonPadding: 'large', expanded: true, buttonRounded: 'default', onClick: onDone }, { children: "Continue" })) })), displayPoweredByDynamicFooter && (jsx(PoweredByDynamic, { classNameRoot: 'transaction-status-layout__footer' }))] }))] })));
53
+ const networkIcon = (jsx("span", Object.assign({ className: 'transaction-status-layout__network-icon' }, { children: NetworkIcon })));
54
+ return (jsxs("div", Object.assign({ className: 'transaction-status-layout' }, { children: [jsx(ModalHeader, Object.assign({ trailing: closeButton, alignContent: 'bottom' }, { children: jsx(IconWithStatus, { containerClassName: 'transaction-status-layout__status-icon', iconSize: 50, Icon: SvgSignCircle, InnerIcon: SvgCheck }) })), jsxs("div", Object.assign({ className: 'transaction-status-layout__body' }, { children: [jsx(Typography, Object.assign({ weight: 'medium', variant: 'title', color: 'primary', className: 'transaction-status-layout__title' }, { children: "Transaction successfully sent" })), jsx("div", Object.assign({ className: 'transaction-status-layout__content' }, { children: jsxs("div", Object.assign({ className: 'transaction-status-layout__rows' }, { children: [jsx(TransactionRow, Object.assign({ label: 'Recipient' }, { children: shortenWalletAddress(destinationAddress, 3, 3) })), jsxs(TransactionRow, Object.assign({ label: 'Network' }, { children: [networkIcon, jsx("span", Object.assign({ className: 'transaction-status-layout__network-name' }, { children: networkName }))] })), jsxs(TransactionRow, Object.assign({ label: 'Total amount' }, { children: [amount, jsx(Typography, Object.assign({ as: 'span', color: 'secondary', className: 'transaction-status-layout__network-currency' }, { children: networkCurrency }))] }))] })) })), jsx("div", Object.assign({ className: 'transaction-status-layout__actions' }, { children: jsx(Button, Object.assign({ buttonVariant: 'primary', buttonPadding: 'large', expanded: true, buttonRounded: 'default', onClick: onDone, loading: false }, { children: "Continue" })) })), displayPoweredByDynamicFooter && (jsx(PoweredByDynamic, { classNameRoot: 'transaction-status-layout__footer' }))] }))] })));
55
55
  };
56
56
 
57
57
  export { TransactionStatusLayout };
@@ -250,6 +250,9 @@ const DynamicContextProvider = ({ children, theme, settings, }) => {
250
250
  setWalletsToConnectByChain(walletsByChain);
251
251
  setShowBridgeWidget(false);
252
252
  localStorage.LocalStorage.removeFromLS(localStorage$1.WALLET_PICKER_SEARCH_KEY);
253
+ if (!toolkitEnabled) {
254
+ localStorage.LocalStorage.removeFromLS(localStorage$1.IS_MULTI_WALLET_ENABLED);
255
+ }
253
256
  const jwt = getAuthToken.getAuthToken();
254
257
  if (jwt && user) {
255
258
  // do not await this async call - just fire and forget
@@ -261,7 +264,8 @@ const DynamicContextProvider = ({ children, theme, settings, }) => {
261
264
  yield ((_j = connectedWallet === null || connectedWallet === void 0 ? void 0 : connectedWallet.connector) === null || _j === void 0 ? void 0 : _j.endSession());
262
265
  // Necessary when user logs out in user data collection view
263
266
  // Dont require flag to be set though
264
- setIsVerificationInProgress(false, false);
267
+ if (isVerificationInProgress)
268
+ setIsVerificationInProgress(false);
265
269
  setLegacyIsVerifying(false);
266
270
  setAuthMode(initialAuthenticationMode);
267
271
  setShowAuthFlow(false);
@@ -367,7 +371,8 @@ const DynamicContextProvider = ({ children, theme, settings, }) => {
367
371
  const clearStatesOnBackClick = React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
368
372
  setDesktopUri('');
369
373
  // Clear verification flag but dont require it to be set
370
- setIsVerificationInProgress(false, false);
374
+ if (isVerificationInProgress)
375
+ setIsVerificationInProgress(false);
371
376
  setLegacyIsVerifying(false);
372
377
  if (!user) {
373
378
  clearAllWalletConnectSessions();
@@ -10,7 +10,7 @@ import { Toolkit } from '../../components/Toolkit/Toolkit.js';
10
10
  import { decodeJwt } from '../../shared/utils/functions/decodeJwt/decodeJwt.js';
11
11
  import { ViewContextProvider } from '../ViewContext/ViewContext.js';
12
12
  import { logger } from '../../shared/logger.js';
13
- import { IS_FULLY_CONNECTED, AUTH_TOKEN, AUTH_USER, AUTH_MODE, WALLET_PICKER_SEARCH_KEY } from '../../utils/constants/localStorage.js';
13
+ import { IS_FULLY_CONNECTED, AUTH_TOKEN, AUTH_USER, AUTH_MODE, WALLET_PICKER_SEARCH_KEY, IS_MULTI_WALLET_ENABLED } from '../../utils/constants/localStorage.js';
14
14
  import '../../utils/constants/colors.js';
15
15
  import { DEFAULT_NUMBER_OF_WALLETS_TO_SHOW } from '../../utils/constants/values.js';
16
16
  import { LocalStorage } from '../../shared/utils/classes/storage/localStorage.js';
@@ -246,6 +246,9 @@ const DynamicContextProvider = ({ children, theme, settings, }) => {
246
246
  setWalletsToConnectByChain(walletsByChain);
247
247
  setShowBridgeWidget(false);
248
248
  LocalStorage.removeFromLS(WALLET_PICKER_SEARCH_KEY);
249
+ if (!toolkitEnabled) {
250
+ LocalStorage.removeFromLS(IS_MULTI_WALLET_ENABLED);
251
+ }
249
252
  const jwt = getAuthToken();
250
253
  if (jwt && user) {
251
254
  // do not await this async call - just fire and forget
@@ -257,7 +260,8 @@ const DynamicContextProvider = ({ children, theme, settings, }) => {
257
260
  yield ((_j = connectedWallet === null || connectedWallet === void 0 ? void 0 : connectedWallet.connector) === null || _j === void 0 ? void 0 : _j.endSession());
258
261
  // Necessary when user logs out in user data collection view
259
262
  // Dont require flag to be set though
260
- setIsVerificationInProgress(false, false);
263
+ if (isVerificationInProgress)
264
+ setIsVerificationInProgress(false);
261
265
  setLegacyIsVerifying(false);
262
266
  setAuthMode(initialAuthenticationMode);
263
267
  setShowAuthFlow(false);
@@ -363,7 +367,8 @@ const DynamicContextProvider = ({ children, theme, settings, }) => {
363
367
  const clearStatesOnBackClick = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
364
368
  setDesktopUri('');
365
369
  // Clear verification flag but dont require it to be set
366
- setIsVerificationInProgress(false, false);
370
+ if (isVerificationInProgress)
371
+ setIsVerificationInProgress(false);
367
372
  setLegacyIsVerifying(false);
368
373
  if (!user) {
369
374
  clearAllWalletConnectSessions();
@@ -22,10 +22,20 @@ const useVerificationInProgress = () => {
22
22
  // because when modal is closed manually, the flag will be false at the moment of onAuthModalClose.
23
23
  // If it was closed due to a verification process, it will be true.
24
24
  const [isVerificationInProgress, _setIsVerificationInProgress] = React.useState(false);
25
- const setIsVerificationInProgress = (newValue, checkWasSetOnDisable = true) => {
26
- if (checkWasSetOnDisable && !newValue && !isVerificationInProgress)
25
+ // Detects whether the flag is being set to false when it was already false
26
+ const detectRedundantDisable = (newValue, oldValue) => {
27
+ if (!newValue && !oldValue)
27
28
  logger.logger.debug('The "isVerificationInProgress" flag had not been previously enabled at the time of being disabled. Please ensure to set it to true whenever any kind of verification process is started');
28
- _setIsVerificationInProgress(newValue);
29
+ };
30
+ // eslint-disable-next-line multiline-comment-style
31
+ /** Setter for isVerificationInProgress that also logs a debug message if
32
+ * it is set to false without having been set to true before */
33
+ const setIsVerificationInProgress = (newValue) => {
34
+ // Calls original setter with a callback. This prevents accessing an outdated value of isVerificationInProgress
35
+ _setIsVerificationInProgress((oldValue) => {
36
+ detectRedundantDisable(newValue, oldValue);
37
+ return newValue;
38
+ });
29
39
  };
30
40
  return [isVerificationInProgress, setIsVerificationInProgress];
31
41
  };
@@ -18,10 +18,20 @@ const useVerificationInProgress = () => {
18
18
  // because when modal is closed manually, the flag will be false at the moment of onAuthModalClose.
19
19
  // If it was closed due to a verification process, it will be true.
20
20
  const [isVerificationInProgress, _setIsVerificationInProgress] = useState(false);
21
- const setIsVerificationInProgress = (newValue, checkWasSetOnDisable = true) => {
22
- if (checkWasSetOnDisable && !newValue && !isVerificationInProgress)
21
+ // Detects whether the flag is being set to false when it was already false
22
+ const detectRedundantDisable = (newValue, oldValue) => {
23
+ if (!newValue && !oldValue)
23
24
  logger.debug('The "isVerificationInProgress" flag had not been previously enabled at the time of being disabled. Please ensure to set it to true whenever any kind of verification process is started');
24
- _setIsVerificationInProgress(newValue);
25
+ };
26
+ // eslint-disable-next-line multiline-comment-style
27
+ /** Setter for isVerificationInProgress that also logs a debug message if
28
+ * it is set to false without having been set to true before */
29
+ const setIsVerificationInProgress = (newValue) => {
30
+ // Calls original setter with a callback. This prevents accessing an outdated value of isVerificationInProgress
31
+ _setIsVerificationInProgress((oldValue) => {
32
+ detectRedundantDisable(newValue, oldValue);
33
+ return newValue;
34
+ });
25
35
  };
26
36
  return [isVerificationInProgress, setIsVerificationInProgress];
27
37
  };
@@ -29,7 +29,7 @@ export interface IDynamicContext {
29
29
  setBridgeChainToConnect: Dispatch<SetStateAction<Chain | undefined>>;
30
30
  clearStatesOnBackClick: () => void;
31
31
  computeConnectedStateForWallets: () => Promise<void>;
32
- connectWallet: (walletConnector: WalletConnector, fetchPublicAddressOpts?: FetchPublicAddressOpts) => Promise<string | undefined>;
32
+ connectWallet: (walletConnector: WalletConnector, fetchPublicAddressOpts?: FetchPublicAddressOpts, shouldCallCallback?: boolean) => Promise<string | undefined>;
33
33
  connectedWallet: Wallet | null;
34
34
  connectedWallets: Wallet[];
35
35
  linkedWallets: Wallet[];
@@ -126,7 +126,7 @@ export interface IDynamicContext {
126
126
  user: UserProfile | undefined;
127
127
  unlinkConnectedWallet: (walletId: string) => void;
128
128
  walletConnector: WalletConnector | null;
129
- walletUiUtils: WalletUiUtils;
129
+ walletUiUtils: WalletUiUtils<WalletConnector>;
130
130
  wallets: WalletOption[];
131
131
  walletsFilter?: (options: WalletOption[]) => WalletOption[];
132
132
  removeConnectedWalletsInfo: () => void;
@@ -18,6 +18,7 @@ var usePreventPageScroll = require('../../shared/utils/hooks/usePreventPageScrol
18
18
  var index = require('../../shared/consts/index.cjs');
19
19
  require('../../context/DynamicContext/DynamicContext.cjs');
20
20
  require('@dynamic-labs/multi-wallet');
21
+ var isMagicConnector = require('../../utils/functions/isMagicConnector/isMagicConnector.cjs');
21
22
  require('../../components/ShadowDOM/ShadowDOM.cjs');
22
23
  require('../../context/ThemeContext/ThemeContext.cjs');
23
24
  var Portal = require('../../components/Portal/Portal.cjs');
@@ -37,6 +38,7 @@ require('../../components/Alert/Alert.cjs');
37
38
  require('../../context/MockContext/MockContext.cjs');
38
39
  require('../../context/CaptchaContext/CaptchaContext.cjs');
39
40
  require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
41
+ var useTransactionWithGasPrice = require('../../utils/hooks/useTransactionWithGasPrice/useTransactionWithGasPrice.cjs');
40
42
  require('../../components/Popper/Popper/Popper.cjs');
41
43
  require('../../components/Popper/PopperContext/PopperContext.cjs');
42
44
  require('formik');
@@ -46,11 +48,17 @@ var ModalCard = require('../../components/ModalCard/ModalCard.cjs');
46
48
  require('../../components/InlineWidget/InlineWidget.cjs');
47
49
  require('../../components/MenuList/Dropdown/Dropdown.cjs');
48
50
 
49
- const TransactionConfirmationModal = ({ title, handler, onReject, onTransactionResponseSuccess, transaction, provider, }) => {
51
+ const TransactionConfirmationModal = ({ title, handler, onReject, onTransactionResponseSuccess, transaction, provider, walletConnector, }) => {
50
52
  usePreventPageScroll.usePreventPageScroll(true);
51
53
  const [show, setShow] = React.useState(true);
52
54
  const errorRef = React.useRef(null);
53
55
  const transactionResponseRef = React.useRef(null);
56
+ const transactionWithGasPrice = useTransactionWithGasPrice.useTransactionWithGasPrice({
57
+ enabled: isMagicConnector.isMagicConnector(walletConnector),
58
+ increasePercentage: 5,
59
+ provider,
60
+ transaction,
61
+ });
54
62
  const closeModal = React.useCallback(() => {
55
63
  setShow(false);
56
64
  }, [setShow]);
@@ -62,7 +70,7 @@ const TransactionConfirmationModal = ({ title, handler, onReject, onTransactionR
62
70
  }, [onTransactionResponseSuccess, onReject]);
63
71
  return (jsxRuntime.jsx(Portal.Portal, Object.assign({ handleClose: closeModal, isShown: show, zIndex: index.authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
64
72
  onUnmount: handleOnModalUnmount,
65
- } }, { children: jsxRuntime.jsx(Modal.Modal, { children: jsxRuntime.jsx(ModalCard.ModalCard, { children: jsxRuntime.jsx(TransactionConfirmationView.TransactionConfirmationView, { provider: provider, transaction: transaction, title: title, mutation: () => handler(transaction), onClickClose: closeModal, onError: (error) => (errorRef.current = error), displayPoweredByDynamicFooter: true, onSuccess: (transactionResponse) => {
73
+ } }, { children: jsxRuntime.jsx(Modal.Modal, { children: jsxRuntime.jsx(ModalCard.ModalCard, { children: jsxRuntime.jsx(TransactionConfirmationView.TransactionConfirmationView, { provider: provider, transaction: transactionWithGasPrice, title: title, mutation: () => handler(transactionWithGasPrice), onClickClose: closeModal, onError: (error) => (errorRef.current = error), displayPoweredByDynamicFooter: true, onSuccess: (transactionResponse) => {
66
74
  errorRef.current = null;
67
75
  transactionResponseRef.current = transactionResponse;
68
76
  closeModal();
@@ -14,6 +14,7 @@ import { usePreventPageScroll } from '../../shared/utils/hooks/usePreventPageScr
14
14
  import { authModalZIndex } from '../../shared/consts/index.js';
15
15
  import '../../context/DynamicContext/DynamicContext.js';
16
16
  import '@dynamic-labs/multi-wallet';
17
+ import { isMagicConnector } from '../../utils/functions/isMagicConnector/isMagicConnector.js';
17
18
  import '../../components/ShadowDOM/ShadowDOM.js';
18
19
  import '../../context/ThemeContext/ThemeContext.js';
19
20
  import { Portal } from '../../components/Portal/Portal.js';
@@ -33,6 +34,7 @@ import '../../components/Alert/Alert.js';
33
34
  import '../../context/MockContext/MockContext.js';
34
35
  import '../../context/CaptchaContext/CaptchaContext.js';
35
36
  import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
37
+ import { useTransactionWithGasPrice } from '../../utils/hooks/useTransactionWithGasPrice/useTransactionWithGasPrice.js';
36
38
  import '../../components/Popper/Popper/Popper.js';
37
39
  import '../../components/Popper/PopperContext/PopperContext.js';
38
40
  import 'formik';
@@ -42,11 +44,17 @@ import { ModalCard } from '../../components/ModalCard/ModalCard.js';
42
44
  import '../../components/InlineWidget/InlineWidget.js';
43
45
  import '../../components/MenuList/Dropdown/Dropdown.js';
44
46
 
45
- const TransactionConfirmationModal = ({ title, handler, onReject, onTransactionResponseSuccess, transaction, provider, }) => {
47
+ const TransactionConfirmationModal = ({ title, handler, onReject, onTransactionResponseSuccess, transaction, provider, walletConnector, }) => {
46
48
  usePreventPageScroll(true);
47
49
  const [show, setShow] = useState(true);
48
50
  const errorRef = useRef(null);
49
51
  const transactionResponseRef = useRef(null);
52
+ const transactionWithGasPrice = useTransactionWithGasPrice({
53
+ enabled: isMagicConnector(walletConnector),
54
+ increasePercentage: 5,
55
+ provider,
56
+ transaction,
57
+ });
50
58
  const closeModal = useCallback(() => {
51
59
  setShow(false);
52
60
  }, [setShow]);
@@ -58,7 +66,7 @@ const TransactionConfirmationModal = ({ title, handler, onReject, onTransactionR
58
66
  }, [onTransactionResponseSuccess, onReject]);
59
67
  return (jsx(Portal, Object.assign({ handleClose: closeModal, isShown: show, zIndex: authModalZIndex, withBackdrop: true, elementId: 'dynamic-send-transaction', transitionEvents: {
60
68
  onUnmount: handleOnModalUnmount,
61
- } }, { children: jsx(Modal, { children: jsx(ModalCard, { children: jsx(TransactionConfirmationView, { provider: provider, transaction: transaction, title: title, mutation: () => handler(transaction), onClickClose: closeModal, onError: (error) => (errorRef.current = error), displayPoweredByDynamicFooter: true, onSuccess: (transactionResponse) => {
69
+ } }, { children: jsx(Modal, { children: jsx(ModalCard, { children: jsx(TransactionConfirmationView, { provider: provider, transaction: transactionWithGasPrice, title: title, mutation: () => handler(transactionWithGasPrice), onClickClose: closeModal, onError: (error) => (errorRef.current = error), displayPoweredByDynamicFooter: true, onSuccess: (transactionResponse) => {
62
70
  errorRef.current = null;
63
71
  transactionResponseRef.current = transactionResponse;
64
72
  closeModal();
@@ -1,5 +1,6 @@
1
1
  import { FC, ReactNode } from 'react';
2
2
  import { ethers } from 'ethers';
3
+ import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
3
4
  export type TransactionConfirmationModalProps = {
4
5
  handler: (transaction: ethers.utils.Deferrable<ethers.providers.TransactionRequest>) => Promise<ethers.providers.TransactionResponse>;
5
6
  onReject: (error: unknown) => void;
@@ -7,5 +8,6 @@ export type TransactionConfirmationModalProps = {
7
8
  provider: ethers.providers.Web3Provider;
8
9
  title: ReactNode;
9
10
  transaction: ethers.utils.Deferrable<ethers.providers.TransactionRequest>;
11
+ walletConnector: WalletConnector;
10
12
  };
11
13
  export type TransactionConfirmationModalComponent = FC<TransactionConfirmationModalProps>;